function Builder::addItems
@psalm-param array<string, TestType> $tests
1 call to Builder::addItems()
- Builder::build in vendor/
phpunit/ php-code-coverage/ src/ Node/ Builder.php
File
-
vendor/
phpunit/ php-code-coverage/ src/ Node/ Builder.php, line 63
Class
- Builder
- @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
Namespace
SebastianBergmann\CodeCoverage\NodeCode
private function addItems(Directory $root, array $items, array $tests) : void {
foreach ($items as $key => $value) {
$key = (string) $key;
if (str_ends_with($key, '/f')) {
$key = substr($key, 0, -2);
$filename = $root->pathAsString() . DIRECTORY_SEPARATOR . $key;
if (is_file($filename)) {
$root->addFile(new File($key, $root, $value['lineCoverage'], $value['functionCoverage'], $tests, $this->analyser
->classesIn($filename), $this->analyser
->traitsIn($filename), $this->analyser
->functionsIn($filename), $this->analyser
->linesOfCodeFor($filename)));
}
}
else {
$child = $root->addDirectory($key);
$this->addItems($child, $value, $tests);
}
}
}