Total Complexity | 4 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Coverage | 50% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | class BeforeReplaceVariableInCachedUrlEvent |
||
27 | { |
||
28 | /** |
||
29 | * @var UriInterface |
||
30 | */ |
||
31 | protected $uri; |
||
32 | |||
33 | /** |
||
34 | * Routing is enabled |
||
35 | * |
||
36 | * @var bool |
||
37 | */ |
||
38 | protected $routing = false; |
||
39 | |||
40 | /** |
||
41 | * BeforeReplaceVariableInCachedUrlEvent constructor. |
||
42 | * @param UriInterface $uri |
||
43 | * @param bool $routing |
||
44 | */ |
||
45 | 35 | public function __construct(UriInterface $uri, bool $routing = false) |
|
46 | { |
||
47 | 35 | $this->uri = $uri; |
|
48 | 35 | $this->routing = $routing; |
|
49 | 35 | } |
|
50 | |||
51 | /** |
||
52 | * Returns the URI |
||
53 | * |
||
54 | * @return UriInterface |
||
55 | */ |
||
56 | 35 | public function getUri(): UriInterface |
|
57 | { |
||
58 | 35 | return $this->uri; |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * Replace the URI object |
||
63 | * |
||
64 | * @param UriInterface $uri |
||
65 | */ |
||
66 | public function replaceUri(UriInterface $uri) |
||
67 | { |
||
68 | $this->uri = $uri; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @return bool |
||
73 | */ |
||
74 | 35 | public function hasRouting(): bool |
|
77 | } |
||
78 | } |
||
79 |