Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | trait OwnerTrait |
||
8 | { |
||
9 | use Helper, |
||
10 | CheckTrait; |
||
11 | |||
12 | public function loadIn(string $name) |
||
13 | { |
||
14 | $this->hasRouteName($name); |
||
15 | $this->loaded = true; |
||
16 | return $this; |
||
17 | } |
||
18 | |||
19 | public function runIn(string $name) |
||
20 | { |
||
21 | $this->hasRouteName($name); |
||
22 | |||
23 | if(!$this->loaded()) { |
||
24 | $this->loadIn($name); |
||
25 | } |
||
26 | |||
27 | return $this; |
||
28 | } |
||
29 | |||
30 | public function hasCurrentRoute(): void |
||
31 | { |
||
32 | if(!isset($this->currentRoute)) { |
||
33 | throw new \RuntimeException('Route not yet loaded'); |
||
34 | } |
||
35 | } |
||
36 | |||
37 | public function unsetRoute($key) |
||
43 | } |
||
44 | |||
45 | } |
||
46 |