function CodeUnit::ensureUserDefinedInterface
@psalm-param class-string $interfaceName
Throws
2 calls to CodeUnit::ensureUserDefinedInterface()
- CodeUnit::forInterface in vendor/
sebastian/ code-unit/ src/ CodeUnit.php - @psalm-param class-string $interfaceName
- CodeUnit::forInterfaceMethod in vendor/
sebastian/ code-unit/ src/ CodeUnit.php - @psalm-param class-string $interfaceName
File
-
vendor/
sebastian/ code-unit/ src/ CodeUnit.php, line 348
Class
- CodeUnit
- @psalm-immutable
Namespace
SebastianBergmann\CodeUnitCode
private static function ensureUserDefinedInterface(string $interfaceName) : void {
try {
$reflector = new ReflectionClass($interfaceName);
if (!$reflector->isInterface()) {
throw new InvalidCodeUnitException(sprintf('"%s" is not an interface', $interfaceName));
}
if (!$reflector->isUserDefined()) {
throw new InvalidCodeUnitException(sprintf('"%s" is not a user-defined interface', $interfaceName));
}
// @codeCoverageIgnoreStart
} catch (\ReflectionException $e) {
throw new ReflectionException($e->getMessage(), $e->getCode(), $e);
}
// @codeCoverageIgnoreEnd
}