Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
15 | 2 | protected function getAttributes() |
|
16 | { |
||
17 | $rows = [ |
||
18 | 2 | 'uri' => 404, |
|
19 | ]; |
||
20 | 2 | if ($this->hasLaravel() === true) { |
|
21 | 1 | $router = $this->laravel['router']; |
|
22 | 1 | $currentRoute = $router->getCurrentRoute(); |
|
23 | 1 | if (is_null($currentRoute) === false) { |
|
24 | 1 | $rows = array_merge([ |
|
25 | 1 | 'uri' => $currentRoute->uri(), |
|
26 | 1 | ], $currentRoute->getAction()); |
|
27 | } |
||
28 | } else { |
||
29 | 1 | $rows['uri'] = empty(Arr::get($_SERVER, 'HTTP_HOST')) === true ? |
|
30 | 1 | 404 : Arr::get($_SERVER, 'REQUEST_URI'); |
|
31 | } |
||
32 | |||
33 | 2 | return compact('rows'); |
|
34 | } |
||
35 | } |
||
36 |