Passed
Push — dev6 ( 31e63d...705373 )
by Ron
19:31
created

TechTipPolicy::forceDelete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 0
c 1
b 0
f 0
dl 0
loc 2
rs 10
cc 1
nc 1
nop 2
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\User;
6
use App\Models\TechTip;
7
use App\Traits\AllowTrait;
8
9
use Illuminate\Auth\Access\HandlesAuthorization;
10
11
class TechTipPolicy
12
{
13
    use HandlesAuthorization;
14
    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, $allow
Loading history...
15
16
    /**
17
     *  Determine if a user can add a new Tech Tip
18
     */
19
    public function create(User $user)
20
    {
21
        return $this->checkPermission($user, 'Add Tech Tip');
22
    }
23
24
    /**
25
     *  Determine if a user can edit an existing Tech Tip
26
     */
27
    public function update(User $user)
28
    {
29
        return $this->checkPermission($user, 'Edit Tech Tip');
30
    }
31
32
    /**
33
     *  Determine if a user can soft delete a Tech Tip
34
     */
35
    public function delete(User $user)
36
    {
37
        return $this->checkPermission($user, 'Delete Tech Tip');
38
    }
39
40
    /**
41
     * Determine whether the user can restore the model.
42
     *
43
     * @param  \App\Models\User  $user
44
     * @param  \App\Models\TechTip  $techTip
45
     * @return mixed
46
     */
47
    public function restore(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

47
    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...
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

47
    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...
48
    {
49
        //
50
    }
51
52
    /**
53
     * Determine whether the user can permanently delete the model.
54
     *
55
     * @param  \App\Models\User  $user
56
     * @param  \App\Models\TechTip  $techTip
57
     * @return mixed
58
     */
59
    public function forceDelete(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

59
    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...
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

59
    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...
60
    {
61
        //
62
    }
63
}
64