BossBey File Manager
PHP:
7.4.33
OS:
Linux
User:
root
Root
/
.
/
vendor
/
phpunit
/
php-code-coverage
/
src
/
Report
/
Xml
📤 Upload
📝 New File
📁 New Folder
Close
Editing: File.php
<?php /* * This file is part of the php-code-coverage package. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace SebastianBergmann\CodeCoverage\Report\Xml; class File { /** * @var \DOMDocument */ protected $dom; /** * @var \DOMElement */ protected $contextNode; public function __construct(\DOMElement $context) { $this->dom = $context->ownerDocument; $this->contextNode = $context; } public function getTotals() { $totalsContainer = $this->contextNode->firstChild; if (!$totalsContainer) { $totalsContainer = $this->contextNode->appendChild( $this->dom->createElementNS( '', 'totals' ) ); } return new Totals($totalsContainer); } public function getLineCoverage($line) { $coverage = $this->contextNode->getElementsByTagNameNS( '', 'coverage' )->item(0); if (!$coverage) { $coverage = $this->contextNode->appendChild( $this->dom->createElementNS( '', 'coverage' ) ); } $lineNode = $coverage->appendChild( $this->dom->createElementNS( '', 'line' ) ); return new Coverage($lineNode, $line); } }
Save
Cancel