Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/cartforge.co/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/cartforge.co/vendor/phpmd/phpmd/src/main/php/PHPMD/Renderer/BaselineRenderer.php
<?php

namespace PHPMD\Renderer;

use PHPMD\AbstractRenderer;
use PHPMD\Report;
use PHPMD\Utility\Paths;

class BaselineRenderer extends AbstractRenderer
{
    /** @var string */
    private $basePath;

    /**
     * @param string $basePath
     */
    public function __construct($basePath)
    {
        $this->basePath = $basePath;
    }

    public function renderReport(Report $report)
    {
        // keep track of which violations have been written, to avoid duplicates in the baseline
        $registered = array();

        $writer = $this->getWriter();
        $writer->write('<?xml version="1.0"?>' . PHP_EOL);
        $writer->write('<phpmd-baseline>' . PHP_EOL);

        foreach ($report->getRuleViolations() as $violation) {
            $ruleName   = get_class($violation->getRule());
            $filePath   = Paths::getRelativePath($this->basePath, $violation->getFileName());
            $methodName = $violation->getMethodName();

            // deduplicate similar violations
            $key = $ruleName . $filePath . $methodName;
            if (isset($registered[$key])) {
                continue;
            }

            $xmlTag = sprintf(
                '  <violation rule="%s" file="%s"%s/>' . PHP_EOL,
                $ruleName,
                $filePath,
                $methodName === null ? '' : ' method="' . $methodName . '"'
            );
            $writer->write($xmlTag);
            $registered[$key] = true;
        }

        $writer->write('</phpmd-baseline>' . PHP_EOL);
    }
}

Spamworldpro Mini