Conditions | 4 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
64 | 31 | private function resolveCallback($action, $type): \Closure |
|
65 | { |
||
66 | 31 | if (array_key_exists($action, $this->{$type})) { |
|
67 | 24 | return $this->{$type}[$action]; |
|
68 | } |
||
69 | |||
70 | 20 | foreach ($this->{$type} as $pattern => $callback) { |
|
71 | 8 | if (Str::is($pattern, $action)) { |
|
72 | 8 | return $callback; |
|
73 | } |
||
74 | } |
||
75 | |||
76 | return function () { |
||
77 | 19 | }; |
|
80 |