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 ( b93bc1...ad0dd3 )
by Pedro
12:38
created

FormModal::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 8
dl 0
loc 11
rs 10

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace Backpack\CRUD\app\View\Components;
4
5
class FormModal extends Form
6
{
7
    /**
8
     * Create a new component instance.
9
     *
10
     * @param  string  $controller  The CRUD controller class name
11
     * @param  string  $operation  The operation to use (create, update, etc.)
12
     * @param  string|null  $action  Custom form action URL
13
     * @param  string  $method  Form method (post, put, etc.)
14
     * @param  string  $buttonText  Text to display on the button that opens the modal
15
     * @param  string  $modalTitle  Title for the modal
16
     * @param  string  $buttonClass  CSS classes for the button
17
     */
18
    public function __construct(
19
        public string $controller,
20
        public string $id = 'backpack-form',
21
        public string $operation = 'create',
22
        public string $formRouteOperation = 'create',
23
        public ?string $action = null,
24
        public string $method = 'post',
25
        public string $modalTitle = 'Form',
26
        public string $modalClasses = "modal-dialog modal-lg"
27
    ) {
28
        parent::__construct($controller, $id, $operation, $action, $method);
29
    }
30
31
    /**
32
     * Get the view / contents that represent the component.
33
     *
34
     * @return \Illuminate\Contracts\View\View|\Closure|string
35
     */
36
    public function render()
37
    {
38
        return view('crud::components.form.modal_form', [
39
            'crud' => $this->crud,
40
            'id' => $this->id,
41
            'operation' => $this->operation,
42
            'formRouteOperation' => $this->formRouteOperation,
43
            'action' => $this->action,
44
            'method' => $this->method,
45
            'modalTitle' => $this->modalTitle,
46
            'modalClasses' => $this->modalClasses,
47
        ]);
48
    }
49
}
50