This commit is contained in:
nuno maduro
2026-05-02 18:47:26 +01:00
parent 4280233b40
commit 7bea819978
5 changed files with 86 additions and 127 deletions

View File

@ -104,22 +104,8 @@ final class CoverageCollector
return null;
}
$reflection = new ReflectionClass($className);
assert(property_exists($className, '__filename') && is_string($className::$__filename));
if ($reflection->hasProperty('__filename')) {
$property = $reflection->getProperty('__filename');
if ($property->isStatic()) {
$value = $property->getValue();
if (is_string($value)) {
return $value;
}
}
}
$file = $reflection->getFileName();
return is_string($file) ? $file : null;
return $className::$__filename;
}
}