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
Pull Request — main (#4854)
by Pedro
40:26 queued 25:42
created

Page   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 14
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A page() 0 3 1
A __construct() 0 3 1
A button() 0 2 1
A field() 0 20 2
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Components;
4
5
use Backpack\CRUD\app\Library\Components\Fields\Field;
6
use Backpack\CRUD\app\Library\Components\Interfaces\Components\SmartComponentInterface;
0 ignored issues
show
Bug introduced by
The type Backpack\CRUD\app\Librar...SmartComponentInterface 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...
7
8
/**
9
 * @mixin  Backpack\CRUD\app\Library\Components\Field
10
 */
11
class Page
12
{
13
    public $backpackService;
14
15
    public function __construct()
16
    {
17
        $this->backpackService = app('crud');
18
    }
19
20
    private static function page()
21
    {
22
        return app('crud');
23
    }
24
25
    public static function button(string|array $name)
0 ignored issues
show
Unused Code introduced by
The parameter $name 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

25
    public static function button(/** @scrutinizer ignore-unused */ string|array $name)

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...
26
    {
27
    }
28
29
    public static function field(string|array|SmartComponentInterface $input)
30
    {
31
        $fieldRepository = new CollectionRepository(
32
            function () {
33
                return self::page()->getOperationSetting('fields') ?? collect();
34
            },
35
            function ($collection) {
36
                return self::page()->setOperationSetting('fields', $collection);
37
            }
38
        );
39
40
        if ($input instanceof SmartComponentInterface) {
0 ignored issues
show
introduced by
$input is never a sub-type of Backpack\CRUD\app\Librar...SmartComponentInterface.
Loading history...
41
            $attributes = new AttributeCollection($input->attributes(), $fieldRepository);
42
43
            return $input::makeOf($attributes);
44
        }
45
46
        $input = new AttributeCollection($input, $fieldRepository);
47
48
        return new Field($input);
49
    }
50
}
51