Test Failed
Push — dev6 ( ab8d6f...f89a9a )
by Ron
19:50
created

TechTipPolicy   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 89
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 8
eloc 7
c 2
b 0
f 0
dl 0
loc 89
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A update() 0 3 1
A restore() 0 2 1
A create() 0 3 1
A delete() 0 3 1
A viewAny() 0 2 1
A manage() 0 3 1
A forceDelete() 0 2 1
A view() 0 2 1
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\TechTip;
6
use App\Models\User;
7
use App\Traits\AllowTrait;
8
use Illuminate\Auth\Access\HandlesAuthorization;
9
10
class TechTipPolicy
11
{
12
    use HandlesAuthorization;
13
    use AllowTrait;
1 ignored issue
show
introduced by
The trait App\Traits\AllowTrait requires some properties which are not provided by App\Policies\TechTipPolicy: $role_id, $username, $allow
Loading history...
14
15
    /**
16
     * Determine whether the user can view any models.
17
     *
18
     * @param  \App\Models\User  $user
19
     * @return \Illuminate\Auth\Access\Response|bool
20
     */
21
    public function viewAny(User $user)
0 ignored issues
show
Unused Code introduced by
The parameter $user 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

21
    public function viewAny(/** @scrutinizer ignore-unused */ User $user)

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...
22
    {
23
        //
24
    }
25
26
    /**
27
     * Determine whether the user can view the model.
28
     *
29
     * @param  \App\Models\User  $user
30
     * @param  \App\Models\TechTip  $techTip
31
     * @return \Illuminate\Auth\Access\Response|bool
32
     */
33
    public function view(User $user, TechTip $techTip)
0 ignored issues
show
Unused Code introduced by
The parameter $user 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

33
    public function view(/** @scrutinizer ignore-unused */ User $user, TechTip $techTip)

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 $techTip 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

33
    public function view(User $user, /** @scrutinizer ignore-unused */ TechTip $techTip)

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...
34
    {
35
        //
36
    }
37
38
    public function manage(User $user)
39
    {
40
        return $this->checkPermission($user, 'Manage Tech Tips');
41
    }
42
43
    /**
44
     * Determine whether the user can create models.
45
     *
46
     * @param  \App\Models\User  $user
47
     * @return \Illuminate\Auth\Access\Response|bool
48
     */
49
    public function create(User $user)
50
    {
51
        return $this->checkPermission($user, 'Add Tech Tip');
52
    }
53
54
    /**
55
     * Determine whether the user can update the model.
56
     *
57
     * @param  \App\Models\User  $user
58
     * @param  \App\Models\TechTip  $techTip
59
     * @return \Illuminate\Auth\Access\Response|bool
60
     */
61
    public function update(User $user, TechTip $techTip)
0 ignored issues
show
Unused Code introduced by
The parameter $techTip 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

61
    public function update(User $user, /** @scrutinizer ignore-unused */ TechTip $techTip)

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...
62
    {
63
        return $this->checkPermission($user, 'Edit Tech Tip');
64
    }
65
66
    /**
67
     * Determine whether the user can delete the model.
68
     *
69
     * @param  \App\Models\User  $user
70
     * @param  \App\Models\TechTip  $techTip
71
     * @return \Illuminate\Auth\Access\Response|bool
72
     */
73
    public function delete(User $user, TechTip $techTip)
0 ignored issues
show
Unused Code introduced by
The parameter $techTip 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

73
    public function delete(User $user, /** @scrutinizer ignore-unused */ TechTip $techTip)

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...
74
    {
75
        return $this->checkPermission($user, 'Delete Tech Tip');
76
    }
77
78
    /**
79
     * Determine whether the user can restore the model.
80
     *
81
     * @param  \App\Models\User  $user
82
     * @param  \App\Models\TechTip  $techTip
83
     * @return \Illuminate\Auth\Access\Response|bool
84
     */
85
    public function restore(User $user, TechTip $techTip)
0 ignored issues
show
Unused Code introduced by
The parameter $techTip 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

85
    public function restore(User $user, /** @scrutinizer ignore-unused */ TechTip $techTip)

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 $user 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

85
    public function restore(/** @scrutinizer ignore-unused */ User $user, TechTip $techTip)

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...
86
    {
87
        //
88
    }
89
90
    /**
91
     * Determine whether the user can permanently delete the model.
92
     *
93
     * @param  \App\Models\User  $user
94
     * @param  \App\Models\TechTip  $techTip
95
     * @return \Illuminate\Auth\Access\Response|bool
96
     */
97
    public function forceDelete(User $user, TechTip $techTip)
0 ignored issues
show
Unused Code introduced by
The parameter $techTip 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

97
    public function forceDelete(User $user, /** @scrutinizer ignore-unused */ TechTip $techTip)

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 $user 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

97
    public function forceDelete(/** @scrutinizer ignore-unused */ User $user, TechTip $techTip)

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...
98
    {
99
        //
100
    }
101
}
102