1 | <?php |
||
34 | class Lom |
||
35 | { |
||
36 | /** @var ReflectionClass */ |
||
37 | protected $reflection; |
||
38 | |||
39 | /** @var Reader */ |
||
40 | protected $register; |
||
41 | |||
42 | /** @var */ |
||
43 | protected $property; |
||
44 | |||
45 | /** @var */ |
||
46 | protected $parsed; |
||
47 | |||
48 | /** @var */ |
||
49 | protected $method; |
||
50 | |||
51 | /** @var CodeParser */ |
||
52 | protected $parser; |
||
53 | |||
54 | /** @var Throwable|ThrowInconsistency */ |
||
55 | protected $throw; |
||
56 | |||
57 | /** |
||
58 | * @param CodeParser $parser |
||
59 | * @param Throwable|null $throw |
||
60 | */ |
||
61 | public function __construct(CodeParser $parser, Throwable $throw = null) |
||
66 | |||
67 | /** |
||
68 | * @param string $className |
||
69 | * |
||
70 | * @throws \ReflectionException |
||
71 | * |
||
72 | * @return Lom |
||
73 | */ |
||
74 | final public function target(string $className): Lom |
||
80 | |||
81 | /** |
||
82 | * @param AnnotationRegister $register |
||
83 | * |
||
84 | * @throws \Doctrine\Common\Annotations\AnnotationException |
||
85 | * |
||
86 | * @return Lom |
||
87 | */ |
||
88 | final public function register(AnnotationRegister $register): Lom |
||
94 | |||
95 | /** |
||
96 | * @return array |
||
97 | */ |
||
98 | public function parseCode(): array |
||
110 | |||
111 | /** |
||
112 | * @return array |
||
113 | */ |
||
114 | public function getParsed(): ?array |
||
118 | |||
119 | /** |
||
120 | * @param array $parsed |
||
121 | */ |
||
122 | protected function parseClassAnnotations(array $parsed) |
||
130 | |||
131 | /** |
||
132 | * @param array $parsed |
||
133 | */ |
||
134 | protected function parsePropertyAnnotations(array $parsed) |
||
143 | |||
144 | /** |
||
145 | * @param array $parsed |
||
146 | * @param $annotation |
||
147 | * |
||
148 | * @return array|null |
||
149 | */ |
||
150 | protected function callFactory(array $parsed, $annotation): ?array |
||
161 | |||
162 | /** |
||
163 | * @param ReflectionProperty $property |
||
164 | */ |
||
165 | protected function setProperty(ReflectionProperty $property) |
||
169 | } |
||
170 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.