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 — add-form-component ( 5ad161 )
by Pedro
15:49 queued 01:42
created

Form::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 7
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\View\Components;
4
5
use Backpack\CRUD\CrudManager;
6
use Illuminate\View\Component;
7
8
class Form extends Component
9
{
10
    public $crud;
11
12
    /**
13
     * Create a new component instance.
14
     *
15
     * @param string $controller The CRUD controller class name
16
     * @param string $operation The operation to use (create, update, etc.)
17
     * @param string|null $action Custom form action URL
18
     * @param string $method Form method (post, put, etc.)
19
     */
20
    public function __construct(
21
        public string $controller,
22
        public string $operation = 'create',
23
        public ?string $formAction = null,
24
        public string $formMethod = 'post'
25
    ) {
26
        // Get CRUD panel instance from the controller
27
        $this->crud = CrudManager::setupCrudPanel($controller, $operation);
0 ignored issues
show
Bug introduced by
The method setupCrudPanel() does not exist on Backpack\CRUD\CrudManager. 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

27
        /** @scrutinizer ignore-call */ 
28
        $this->crud = CrudManager::setupCrudPanel($controller, $operation);
Loading history...
28
        $this->operation = $operation;
29
        $this->formAction = $action ?? url($this->crud->route);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $action seems to never exist and therefore isset should always be false.
Loading history...
30
    }
31
32
    /**
33
     * Get the view / contents that represent the component.
34
     *
35
     * @return \Illuminate\Contracts\View\View|\Closure|string
36
     */
37
    public function render()
38
    {
39
        return view('crud::components.form.form', [
40
            'crud' => $this->crud,
41
            'operation' => $this->operation,
42
            'formAction' => $this->formAction,
43
            'formMethod' => $this->formMethod,
44
        ]);
45
    }
46
}