Issues (45)

Routes/RouteActionNormalizer.php (1 issue)

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
The parameter $method is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

9
    public function normalize(/** @scrutinizer ignore-unused */ $method, $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
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