Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Push — do-not-initialize-crud-panel-t... ( 9f038b...6730c9 )
by Pedro
12:31
created

CrudRouter   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 8

1 Method

Rating   Name   Duplication   Size   Complexity  
B setupControllerRoutes() 0 25 8
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel;
4
5
use Backpack\CRUD\app\Library\Contracts\CrudControllerContract;
0 ignored issues
show
Bug introduced by
The type Backpack\CRUD\app\Librar...\CrudControllerContract was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Support\Facades\App;
7
use ReflectionClass;
8
9
final class CrudRouter
10
{
11
    public static function setupControllerRoutes(string $name, string $routeName, string $controller, string $groupNamespace = ''): void
12
    {
13
        $namespacedController = $groupNamespace.$controller;
14
            
15
        $controllerReflection = new ReflectionClass($namespacedController);
16
        $setupRoutesMethod = $controllerReflection->getMethod('setupRoutes');
17
18
        // check if method has #[DeprecatedIgnoreOnRuntime] attribute
19
        if (empty($setupRoutesMethod->getAttributes(\Backpack\CRUD\app\Library\Attributes\DeprecatedIgnoreOnRuntime::class))) {
20
            // when the attribute is not found the developer has overwritten the method
21
            // we will keep the old behavior for backwards compatibility
22
            $setupRoutesMethod->invoke(App::make($namespacedController), $name, $routeName, $controller);
23
            return;
24
        }
25
26
        $controllerInstance = $controllerReflection->newInstanceWithoutConstructor();
27
        foreach ($controllerReflection->getMethods() as $method) {
28
            if (($method->isPublic() ||
29
                $method->isProtected()) &&
30
                $method->getName() !== 'setupRoutes' &&
31
                str_starts_with($method->getName(), 'setup') &&
32
                str_ends_with($method->getName(), 'Routes')
33
            ) {
34
                $method->setAccessible(true);
35
                $method->invoke($controllerInstance, $name, $routeName, $controller);
36
            }
37
        }
38
    }
39
}