Completed
Push — feature/backpack ( 16fb41...46736d )
by Chris
10:31 queued 01:05
created

SkillCrudController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace App\Http\Controllers\Admin;
4
5
use Backpack\CRUD\app\Http\Controllers\CrudController;
6
// Validation
7
use App\Http\Requests\SkillCrudRequest as StoreRequest;
8
use App\Http\Requests\SkillCrudRequest as UpdateRequest;
9
10
class SkillCrudController extends CrudController
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class SkillCrudController
Loading history...
11
{
12
    public function setup()
0 ignored issues
show
Coding Style introduced by
Missing doc comment for function setup()
Loading history...
13
    {
14
        $this->crud->setModel("App\Models\Skill");
15
        $this->crud->setRoute("admin/skill");
16
        $this->crud->setEntityNameStrings('skill', 'skills');
17
18
        $this->crud->addColumn([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
19
            'name' => 'name',
20
            'type' => 'text',
21
            'label' => 'Name'
22
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
23
        $this->crud->addColumn([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
24
            'name' => 'description',
25
            'type' => 'text',
26
            'label' => 'Description'
27
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
28
        $this->crud->addColumn([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
29
            'name' => 'skill_type.name',
30
            'type' => 'text',
31
            'label' => 'Type'
32
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
33
34
        $this->crud->addField([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
35
            'name' => 'name',
36
            'type' => 'text',
37
            'label' => "Name"
38
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
39
        $this->crud->addField([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
40
            'name' => 'description',
41
            'type' => 'textarea',
42
            'label' => "Description"
43
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
44
        $this->crud->addField([
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
45
            'label' => "Type",
46
            'type' => 'select',
47
            'name' => 'skill_type_id', // the db column for the foreign key
48
            'entity' => 'skill_type', // the method that defines the relationship in your Model
49
            'attribute' => 'name', // foreign key attribute that is shown to user
50
        ]);
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
51
    }
52
53
    public function store(StoreRequest $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request 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

53
    public function store(/** @scrutinizer ignore-unused */ StoreRequest $request)

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...
Coding Style introduced by
Missing doc comment for function store()
Loading history...
54
    {
55
        return parent::storeCrud();
56
    }
57
58
    public function update(UpdateRequest $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request 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

58
    public function update(/** @scrutinizer ignore-unused */ UpdateRequest $request)

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...
Coding Style introduced by
Missing doc comment for function update()
Loading history...
59
    {
60
        return parent::updateCrud();
61
    }
62
}
63