1 | <?php |
||
47 | class App extends SlimApp |
||
48 | { |
||
49 | /** |
||
50 | * @var Reader |
||
51 | */ |
||
52 | protected $reader; |
||
53 | |||
54 | /** |
||
55 | * App constructor. |
||
56 | * |
||
57 | * @param string $controllersDir |
||
58 | * @param array|ContainerInterface $container |
||
59 | * |
||
60 | * @throws InvalidArgumentException |
||
61 | * @throws \InvalidArgumentException |
||
62 | * @throws \Doctrine\Common\Annotations\AnnotationException |
||
63 | * @throws \ReflectionException |
||
64 | */ |
||
65 | 6 | public function __construct(string $controllersDir, $container = []) |
|
77 | |||
78 | |||
79 | /** |
||
80 | * @param string $controllerDir |
||
81 | * |
||
82 | * @return void |
||
83 | * @throws \InvalidArgumentException |
||
84 | * @throws \ReflectionException |
||
85 | */ |
||
86 | 5 | protected function loadControllers(string $controllerDir): void |
|
96 | |||
97 | /** |
||
98 | * @param string $class |
||
99 | * |
||
100 | * @return void |
||
101 | * @throws \ReflectionException |
||
102 | * @throws \InvalidArgumentException |
||
103 | */ |
||
104 | 5 | protected function addRoutes(string $class): void |
|
146 | |||
147 | /** |
||
148 | * @param array $annotations |
||
149 | * @param string $name |
||
150 | * |
||
151 | * @return object|null |
||
152 | */ |
||
153 | 5 | protected function getAnnotation(array $annotations, string $name) |
|
163 | |||
164 | /** |
||
165 | * @param string $controllerDir |
||
166 | * |
||
167 | * @return Generator|SplFileInfo |
||
168 | */ |
||
169 | 5 | protected function getControllerFiles(string $controllerDir) |
|
170 | { |
||
171 | 5 | $directoryIterator = new RecursiveDirectoryIterator( |
|
172 | 5 | $controllerDir, |
|
173 | 5 | FilesystemIterator::SKIP_DOTS | FilesystemIterator::FOLLOW_SYMLINKS |
|
174 | ); |
||
175 | $iterator = new RecursiveCallbackFilterIterator($directoryIterator, function (SplFileInfo $file) { |
||
176 | 5 | return $file->isDir() || ($file->isFile() && $file->getExtension() === 'php'); |
|
177 | 5 | }); |
|
178 | /** @var SplFileInfo $file */ |
||
179 | 5 | foreach (new RecursiveIteratorIterator($iterator) as $file) { |
|
180 | 5 | yield $file; |
|
181 | } |
||
182 | 5 | } |
|
183 | |||
184 | /** |
||
185 | * @param ReflectionClass $relectionClass |
||
186 | * |
||
187 | * @return object |
||
188 | */ |
||
189 | 5 | protected function createControllerInstance(ReflectionClass $relectionClass) |
|
207 | |||
208 | /** |
||
209 | * @return Reader |
||
210 | * @throws \Doctrine\Common\Annotations\AnnotationException |
||
211 | * @throws \InvalidArgumentException |
||
212 | */ |
||
213 | 5 | protected function createAnnotationReader(): Reader |
|
226 | |||
227 | /** |
||
228 | * @param array $methodAnnotations |
||
229 | * @param RouteInterface $route |
||
230 | * |
||
231 | * @return void |
||
232 | */ |
||
233 | 5 | protected function handleActionAnnotations(array $methodAnnotations, RouteInterface $route): void |
|
236 | } |
||
237 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.