ScriptsSectionModelPolicy   A
last analyzed

Complexity

Total Complexity 14

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

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

7 Methods

Rating   Name   Duplication   Size   Complexity  
A display() 0 7 2
A create() 0 7 2
A destroy() 0 7 2
A restore() 0 7 2
A edit() 0 7 2
A before() 0 4 2
A delete() 0 7 2
1
<?php
2
3
namespace App\Admin\Policies;
4
5
use App\Admin\Sections\Scripts as Section;
6
use App\Models\Script as Model;
7
use App\User;
8
use Illuminate\Auth\Access\HandlesAuthorization;
9
10
class ScriptsSectionModelPolicy
11
{
12
    use HandlesAuthorization;
13
14
    /**
15
     * @param User    $user
16
     * @param string  $ability
17
     * @param Scripts $section
18
     * @param Script  $item
19
     *
20
     * @return bool
21
     */
22
    public function before(User $user, $ability, Section $section, Model $item = null)
0 ignored issues
show
Unused Code introduced by
The parameter $ability 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

22
    public function before(User $user, /** @scrutinizer ignore-unused */ $ability, Section $section, Model $item = null)

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...
Unused Code introduced by
The parameter $section 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

22
    public function before(User $user, $ability, /** @scrutinizer ignore-unused */ Section $section, Model $item = null)

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...
Unused Code introduced by
The parameter $item 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

22
    public function before(User $user, $ability, Section $section, /** @scrutinizer ignore-unused */ Model $item = null)

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...
23
    {
24
        if ($user->isAdmin()) {
25
            return true;
26
        }
27
    }
28
29
    public function display(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $item 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

29
    public function display(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
Unused Code introduced by
The parameter $section 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

29
    public function display(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
30
    {
31
        if ($user->isAdmin()) {
32
            return true;
33
        }
34
35
        return false;
36
    }
37
38
    public function create(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $item 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

38
    public function create(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
Unused Code introduced by
The parameter $section 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

38
    public function create(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
39
    {
40
        if ($user->isAdmin()) {
41
            return true;
42
        }
43
44
        return false;
45
    }
46
47
    public function edit(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $section 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

47
    public function edit(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
Unused Code introduced by
The parameter $item 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

47
    public function edit(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
48
    {
49
        if ($user->isAdmin()) {
50
            return true;
51
        }
52
53
        return false;
54
    }
55
56
    public function delete(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $item 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

56
    public function delete(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
Unused Code introduced by
The parameter $section 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

56
    public function delete(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
57
    {
58
        if ($user->isAdmin()) {
59
            return true;
60
        }
61
62
        return false;
63
    }
64
65
    public function restore(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $section 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

65
    public function restore(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
Unused Code introduced by
The parameter $item 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

65
    public function restore(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
66
    {
67
        if ($user->isAdmin()) {
68
            return true;
69
        }
70
71
        return false;
72
    }
73
74
    public function destroy(User $user, Section $section, Model $item)
0 ignored issues
show
Unused Code introduced by
The parameter $section 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

74
    public function destroy(User $user, /** @scrutinizer ignore-unused */ Section $section, Model $item)

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...
Unused Code introduced by
The parameter $item 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

74
    public function destroy(User $user, Section $section, /** @scrutinizer ignore-unused */ Model $item)

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...
75
    {
76
        if ($user->isAdmin()) {
77
            return true;
78
        }
79
80
        return false;
81
    }
82
}
83