1: <?php
2:
3: declare(strict_types=1);
4:
5: namespace PHPStan\BetterReflection\SourceLocator\Type;
6:
7: use PHPStan\BetterReflection\Identifier\Identifier;
8: use PHPStan\BetterReflection\Identifier\IdentifierType;
9: use PHPStan\BetterReflection\Reflection\Reflection;
10: use PHPStan\BetterReflection\Reflector\Reflector;
11:
12: interface SourceLocator
13: {
14: /**
15: * Locate some source code.
16: *
17: * This method should return a LocatedSource value object or `null` if the
18: * SourceLocator is unable to locate the source.
19: *
20: * NOTE: A SourceLocator should *NOT* throw an exception if it is unable to
21: * locate the identifier, it should simply return null. If an exception is
22: * thrown, it will break the Generic Reflector.
23: */
24: public function locateIdentifier(Reflector $reflector, Identifier $identifier): ?\PHPStan\BetterReflection\Reflection\Reflection;
25:
26: /**
27: * Find all identifiers of a type
28: *
29: * @return list<Reflection>
30: */
31: public function locateIdentifiersByType(Reflector $reflector, IdentifierType $identifierType): array;
32: }
33: