Skip to content

Commit

Permalink
Use tokens instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jakublabno committed Apr 3, 2022
1 parent 065ebcb commit b867a4f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Scanner/DoctrineAnnotationsScanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,16 @@ private function getUsedAnnotationsClassPaths(ReflectionMethod ...$reflectionMet
}

/**
* @return ReflectionMethod[]
* @throws ReflectionException
* @return ?ReflectionMethod[]
*/
private function getMethods(string $className): ?array
{
try {
if (!class_exists($className)) {
return null;
}
$reflectedClass = new ReflectionClass($className);
} catch (Throwable $t) {
return null;
}

$reflectedClass = new ReflectionClass($className);

return $reflectedClass->getMethods() ?: null;
}

Expand Down

0 comments on commit b867a4f

Please sign in to comment.