1 | <?php |
||
19 | class RoutingServiceProvider implements |
||
20 | ServiceProviderInterface, |
||
21 | BootableProviderInterface, |
||
22 | EventListenerProviderInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $routingContainerId; |
||
28 | |||
29 | /** |
||
30 | * @param string $routingContainerId |
||
31 | */ |
||
32 | public function __construct($routingContainerId = 'config.routes') |
||
36 | |||
37 | /** |
||
38 | * @param Container $container |
||
39 | */ |
||
40 | public function register(Container $container) |
||
56 | |||
57 | /** |
||
58 | * @param Application $app |
||
59 | * @codeCoverageIgnore |
||
60 | */ |
||
61 | public function boot(Application $app) |
||
64 | |||
65 | /** |
||
66 | * @param Container $container |
||
67 | * @param EventDispatcherInterface $dispatcher |
||
68 | * @codeCoverageIgnore |
||
69 | */ |
||
70 | public function subscribe(Container $container, EventDispatcherInterface $dispatcher) |
||
73 | |||
74 | /** |
||
75 | * Add routes |
||
76 | * |
||
77 | * @param Container $container |
||
78 | * @param array $routes |
||
79 | */ |
||
80 | public function addRoutes(Container $container, array $routes) |
||
86 | |||
87 | /** |
||
88 | * Adds a route, a given route-name (for named routes) and all of its methods |
||
89 | * |
||
90 | * @param Container $app |
||
|
|||
91 | * @param array $route |
||
92 | * @throws InvalidArgumentException |
||
93 | */ |
||
94 | public function addRoute(Container $container, array $route, $name = '') |
||
123 | |||
124 | /** |
||
125 | * Sanitizes the routeName for named route: |
||
126 | * |
||
127 | * - replaces '/', ':', '|', '-' with '_' |
||
128 | * - removes special characters |
||
129 | * |
||
130 | * Algorithm copied from \Silex\Controller->generateRouteName |
||
131 | * see: https://github.com/silexphp/Silex/blob/1.2/src/Silex/Controller.php |
||
132 | * |
||
133 | * @param string $routeName |
||
134 | * @return string |
||
135 | */ |
||
136 | protected function sanitizeRouteName($routeName) |
||
149 | |||
150 | /** |
||
151 | * @param Controller $controller |
||
152 | * @param $actions |
||
153 | * @param $type |
||
154 | * @throws \InvalidArgumentException |
||
155 | */ |
||
156 | protected function addActions(Controller $controller, $actions, $type) |
||
185 | |||
186 | /** |
||
187 | * @param Controller $controller |
||
188 | * @param $name |
||
189 | * @param $value |
||
190 | * @param $type |
||
191 | */ |
||
192 | protected function addAction(Controller $controller, $name, $value, $type) |
||
196 | |||
197 | protected function isClosure($param) |
||
201 | |||
202 | /** |
||
203 | * Adds a middleware (before/after) |
||
204 | * |
||
205 | * @param Controller $controller |
||
206 | * @param string $type | 'before' or 'after' |
||
207 | * @param $value |
||
208 | */ |
||
209 | protected function addBeforeAfterMiddleware(Controller $controller, $type, $value) |
||
230 | |||
231 | /** |
||
232 | * Adds a before/after middleware by its configuration |
||
233 | * |
||
234 | * @param Controller $controller |
||
235 | * @param $type |
||
236 | * @param $value |
||
237 | */ |
||
238 | protected function addMiddlewareFromConfig(Controller $controller, $type, $value) |
||
260 | } |
||
261 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.