1 | <?php |
||
2 | |||
3 | namespace Imanghafoori\HeyMan\Plugins\WatchingStrategies\Routes; |
||
4 | |||
5 | use Illuminate\Support\Str; |
||
6 | |||
7 | final class RouteActionNormalizer |
||
8 | { |
||
9 | 10 | public function normalize($method, $args) |
|
0 ignored issues
–
show
|
|||
10 | { |
||
11 | 10 | return [$this->normalizeAction($args)]; |
|
12 | } |
||
13 | |||
14 | public function normalizeAction($actions) |
||
15 | { |
||
16 | 10 | $addNamespace = function ($action) { |
|
17 | 10 | if (Str::startsWith($action, '\\')) { |
|
18 | 8 | return $action; |
|
19 | } |
||
20 | |||
21 | 2 | return app()->getNamespace().'Http\\Controllers\\'.$action; |
|
22 | 10 | }; |
|
23 | |||
24 | 10 | return array_map($addNamespace, $actions); |
|
25 | } |
||
26 | } |
||
27 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.