TheSeer\phpDox\Generator\Enricher\PHPUnitConfig::getCoveragePath PHP Method

getCoveragePath() public method

public getCoveragePath ( ) : TheSeer\phpDox\FileInfo
return TheSeer\phpDox\FileInfo
    public function getCoveragePath()
    {
        $basedirDefault = dirname($this->context->ownerDocument->baseURI);
        $path = $basedirDefault . '/build/logs';
        if ($this->context->parentNode->hasAttribute('base')) {
            $path = $this->context->parentNode->getAttribute('base');
        }
        if ($path != '') {
            $path .= '/';
        }
        $coverage = $this->context->queryOne('cfg:coverage');
        if ($coverage && $coverage->hasAttribute('path')) {
            $cfgPath = $coverage->getAttribute('path');
            if ($cfgPath[0] === '/') {
                $path = '';
            }
            $path .= $coverage->getAttribute('path');
        } else {
            $path .= 'coverage';
        }
        return new FileInfo($path);
    }

Usage Example

Ejemplo n.º 1
0
 private function loadXML($fname)
 {
     try {
         $fname = $this->config->getCoveragePath() . '/' . $fname;
         if (!file_exists($fname)) {
             throw new EnricherException(sprintf('PHPLoc xml file "%s" not found.', $fname), EnricherException::LoadError);
         }
         $dom = new fDOMDocument();
         $dom->load($fname);
         $dom->registerNamespace('pu', 'http://schema.phpunit.de/coverage/1.0');
         return $dom;
     } catch (fDOMException $e) {
         throw new EnricherException('Parsing PHPLoc xml file failed: ' . $e->getMessage(), EnricherException::LoadError);
     }
 }
All Usage Examples Of TheSeer\phpDox\Generator\Enricher\PHPUnitConfig::getCoveragePath