1 | <?php |
||
20 | class RouteRepository |
||
21 | { |
||
22 | /** |
||
23 | * Prepared URL generator |
||
24 | * |
||
25 | * @var UrlGeneratorInterface |
||
26 | */ |
||
27 | private $urlGenerator; |
||
28 | |||
29 | /** |
||
30 | * Route definitions |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $routes; |
||
35 | |||
36 | /** |
||
37 | * Base url |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $baseUrl; |
||
42 | |||
43 | /** |
||
44 | * RouteRepository constructor. |
||
45 | * |
||
46 | * @param string $baseUrl |
||
47 | * @param array $routes [name => definition] |
||
48 | */ |
||
49 | 6 | public function __construct(string $baseUrl, array $routes) |
|
54 | |||
55 | /** |
||
56 | * Generate URL by route |
||
57 | * |
||
58 | * @param string $name Route name |
||
59 | * @param array $parameters Request parameters |
||
60 | * @return string |
||
61 | */ |
||
62 | 4 | public function generate(string $name, array $parameters = []): string |
|
66 | |||
67 | /** |
||
68 | * Get URL generator |
||
69 | * |
||
70 | * @return UrlGeneratorInterface |
||
71 | */ |
||
72 | 4 | protected function getUrlGenerator(): UrlGeneratorInterface |
|
83 | |||
84 | /** |
||
85 | * Assemble routes collection |
||
86 | * |
||
87 | * @return RouteCollection |
||
88 | */ |
||
89 | 4 | protected function assembleRoutesCollection(): RouteCollection |
|
103 | } |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..