Total Complexity | 6 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class CanonicalUrlGenerator |
||
9 | { |
||
10 | /** @var RouterInterface */ |
||
11 | private $router; |
||
12 | /** @var string */ |
||
13 | private $siteUrl; |
||
14 | /** @var bool */ |
||
15 | private $trailingSlash; |
||
16 | |||
17 | /** |
||
18 | * CanonicalUrlService constructor. |
||
19 | * |
||
20 | * @param RouterInterface $router |
||
21 | * @param array $config |
||
22 | */ |
||
23 | 10 | public function __construct(RouterInterface $router, array $config = []) |
|
29 | 10 | } |
|
30 | |||
31 | /** |
||
32 | * Returns the canonical URL for a route. |
||
33 | * |
||
34 | * @param string $route Route to generate a URL for. |
||
35 | * @param string|array $params String in 'key1=val1&key2=val2' format or array of query parameters. |
||
36 | * |
||
37 | * @return string |
||
38 | */ |
||
39 | 8 | public function generate($route, $params = []) |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * @param string|array $parameters |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | 7 | private function getParameters($parameters = []) |
|
71 |