function CodeCoverage::shouldCodeCoverageBeCollectedFor
@psalm-param class-string $className @psalm-param non-empty-string $methodName
1 call to CodeCoverage::shouldCodeCoverageBeCollectedFor()
- CodeCoverage::linesToBeCovered in vendor/
phpunit/ phpunit/ src/ Metadata/ Api/ CodeCoverage.php - @psalm-param class-string $className @psalm-param non-empty-string $methodName
File
-
vendor/
phpunit/ phpunit/ src/ Metadata/ Api/ CodeCoverage.php, line 219
Class
- CodeCoverage
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\Metadata\ApiCode
public function shouldCodeCoverageBeCollectedFor(string $className, string $methodName) : bool {
$metadataForClass = Registry::parser()->forClass($className);
$metadataForMethod = Registry::parser()->forMethod($className, $methodName);
if ($metadataForMethod->isCoversNothing()
->isNotEmpty()) {
return false;
}
if ($metadataForMethod->isCovers()
->isNotEmpty() || $metadataForMethod->isCoversClass()
->isNotEmpty() || $metadataForMethod->isCoversFunction()
->isNotEmpty()) {
return true;
}
if ($metadataForClass->isCoversNothing()
->isNotEmpty()) {
return false;
}
return true;
}