function Reflection::sourceLocationFor
@psalm-param class-string $className @psalm-param non-empty-string $methodName
@psalm-return array{file: non-empty-string, line: non-negative-int}
2 calls to Reflection::sourceLocationFor()
- DataProvider::valueObjectForTestMethodWithoutTestData in vendor/
phpunit/ phpunit/ src/ Metadata/ Api/ DataProvider.php - @psalm-param class-string $className @psalm-param non-empty-string $methodName
- TestMethodBuilder::fromTestCase in vendor/
phpunit/ phpunit/ src/ Event/ Value/ Test/ TestMethodBuilder.php
File
-
vendor/
phpunit/ phpunit/ src/ Util/ Reflection.php, line 34
Class
- Reflection
- @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Namespace
PHPUnit\UtilCode
public static function sourceLocationFor(string $className, string $methodName) : array {
try {
$reflector = new ReflectionMethod($className, $methodName);
$file = $reflector->getFileName();
$line = $reflector->getStartLine();
} catch (ReflectionException) {
$file = 'unknown';
$line = 0;
}
return [
'file' => $file,
'line' => $line,
];
}