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