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 — next (#5688)
by Pedro
29:10 queued 14:24
created

Datatable::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 16
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 1
eloc 7
c 3
b 1
f 0
nc 1
nop 5
dl 0
loc 16
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Datatable;
4
5
use Backpack\CRUD\app\Library\CrudPanel\CrudPanel;
6
use Illuminate\View\Component;
7
8
class Datatable extends Component
9
{
10
    public function __construct(
11
        private string $controller,
12
        private ?CrudPanel $crud = null,
13
        private bool $updatesUrl = true,
14
        private ?string $tableId = null,
15
        private array $tableOptions = []
16
    ) {
17
        $this->crud ??= \Backpack\CRUD\Backpack::crudFromController($controller);
0 ignored issues
show
Bug introduced by
The method crudFromController() does not exist on Backpack\CRUD\Backpack. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

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

17
        $this->crud ??= \Backpack\CRUD\Backpack::/** @scrutinizer ignore-call */ crudFromController($controller);
Loading history...
18
        $this->tableId = 'crudTable_'.uniqid();
19
20
        // Merge default options with provided options
21
        $this->tableOptions = array_merge([
22
            'pageLength' => $this->crud->getDefaultPageLength(),
0 ignored issues
show
Bug introduced by
The method getDefaultPageLength() does not exist on null. ( Ignorable by Annotation )

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

22
            'pageLength' => $this->crud->/** @scrutinizer ignore-call */ getDefaultPageLength(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
            'searchDelay' => $this->crud->getOperationSetting('searchDelay'),
24
            'searchableTable' => $this->crud->getOperationSetting('searchableTable') ?? true,
25
        ], $tableOptions);
26
    }
27
28
    public function render()
29
    {
30
        return view('crud::datatable.datatable', [
31
            'crud' => $this->crud,
32
            'updatesUrl' => $this->updatesUrl,
33
            'tableId' => $this->tableId,
34
            'tableOptions' => $this->tableOptions,
35
        ]);
36
    }
37
}
38