1 | <?php |
||
22 | final class Name |
||
23 | { |
||
24 | /** |
||
25 | * 'Unnamed' name |
||
26 | */ |
||
27 | public const ANY = ''; |
||
28 | |||
29 | /** @var string */ |
||
30 | private $name = ''; |
||
31 | |||
32 | /** |
||
33 | * Named database |
||
34 | * |
||
35 | * format: array<varName, NamedName> |
||
36 | * |
||
37 | * @var array<string, string> |
||
38 | */ |
||
39 | private $names = []; |
||
40 | |||
41 | public function __construct(?string $name = null) |
||
47 | |||
48 | /** |
||
49 | * Create instance from PHP8 attributes |
||
50 | * |
||
51 | * @psalm-suppress MixedAssignment |
||
52 | * @psalm-suppress UndefinedMethod |
||
53 | * @psalm-suppress MixedMethodCall |
||
54 | * @psalm-suppress MixedArrayAccess |
||
55 | * |
||
56 | * psalm does not know ReflectionAttribute?? PHPStan produces no type error here. |
||
57 | */ |
||
58 | public function createFromAttributes(\ReflectionMethod $method): ?self |
||
76 | |||
77 | public function __invoke(ReflectionParameter $parameter): string |
||
97 | |||
98 | private function setName(string $name): void |
||
119 | |||
120 | /** |
||
121 | * @return array<string, string> |
||
122 | */ |
||
123 | private function parseName(string $name): array |
||
142 | } |
||
143 |