protected function collectCoverage(\SimpleXMLElement $file, $path, $filename)
    {
        if ($this->jsonFile->hasSourceFile($path)) {
            $srcFile = $this->jsonFile->getSourceFile($path);
        } else {
            $srcFile = new SourceFile($path, $filename);
        }

        foreach ($file->line as $line) {
            if ((string) $line['type'] === 'stmt') {
                $lineNum = (int) $line['num'];

                if ($lineNum > 0) {
                    $srcFile->addCoverage($lineNum - 1, (int) $line['count']);
                }
            }
        }

        return $srcFile;
    }
protected function collectCoverage(\SimpleXMLElement $file, $path, $filename)
    {
        if ($this->jsonFile->hasSourceFile($path)) {
            $srcFile = $this->jsonFile->getSourceFile($path);
        } else {
            $srcFile = new SourceFile($path, $filename);
        }

        foreach ($file->line as $line) {
            if ((string) $line['type'] === 'stmt') {
                $lineNum = (int) $line['num'];

                if ($lineNum > 0) {
                    $srcFile->addCoverage($lineNum - 1, (int) $line['count']);
                }
            }
        }

        return $srcFile;
    }
protected function collectCoverage ( \ SimpleXMLElement $ file , $ path , $ filename ) { if ( $ this -> jsonFile -> hasSourceFile ( $ path ) ) { $ srcFile = $ this -> jsonFile -> getSourceFile ( $ path ) ; } else { $ srcFile = new SourceFile ( $ path , $ filename ) ; } foreach ( $ file -> line as $ line ) { if ( ( string ) $ line [ 'type' ] === 'stmt' ) { $ lineNum = ( int ) $ line [ 'num' ] ; if ( $ lineNum > 0 ) { $ srcFile -> addCoverage ( $ lineNum - 1 , ( int ) $ line [ 'count' ] ) ; } } } return $ srcFile ; }
Collect coverage data.

@param \SimpleXMLElement $file     clover XML object of a file
@param string            $path     path to source file
@param string            $filename filename

@return \PhpCoveralls\Bundle\CoverallsBundle\Entity\SourceFile
Collect coverage data .