Passed
Push — dev6 ( edb7de...3fa4bc )
by Ron
15:53
created

CustomerPolicy::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 0
c 2
b 0
f 0
dl 0
loc 2
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 2
crap 2
1
<?php
2
3
namespace App\Policies;
4
5
use App\Models\Customer;
6
use App\Models\User;
7
use App\Traits\AllowTrait;
8
use Illuminate\Auth\Access\HandlesAuthorization;
9
10
class CustomerPolicy
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\CustomerPolicy: $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 20
     * @return \Illuminate\Auth\Access\Response|bool
20
     */
21 20
    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 5
     * Determine whether the user can view the model.
28
     *
29 5
     * @param  \App\Models\User  $user
30
     * @param  \App\Models\Customer  $customer
31
     * @return \Illuminate\Auth\Access\Response|bool
32
     */
33
    public function view(User $user, Customer $customer)
0 ignored issues
show
Unused Code introduced by
The parameter $customer 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 */ Customer $customer)

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

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

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 3
        //
36
    }
37 3
38
    /**
39
     * Determine whether the user can create models.
40
     *
41
     * @param  \App\Models\User  $user
42
     * @return \Illuminate\Auth\Access\Response|bool
43 3
     */
44
    public function create(User $user)
45 3
    {
46
        return $this->checkPermission($user, 'Add Customer');
47
    }
48
49
    /**
50
     * Determine whether the user can update the model.
51
     *
52
     * @param  \App\Models\User  $user
53
     * @param  \App\Models\Customer  $customer
54
     * @return \Illuminate\Auth\Access\Response|bool
55
     */
56
    public function update(User $user, Customer $customer)
0 ignored issues
show
Unused Code introduced by
The parameter $customer 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 update(User $user, /** @scrutinizer ignore-unused */ Customer $customer)

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

56
    public function update(/** @scrutinizer ignore-unused */ User $user, Customer $customer)

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
        //
59
    }
60
61
    /**
62
     * Determine whether the user can delete the model.
63
     *
64
     * @param  \App\Models\User  $user
65
     * @param  \App\Models\Customer  $customer
66
     * @return \Illuminate\Auth\Access\Response|bool
67
     */
68
    public function delete(User $user, Customer $customer)
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

68
    public function delete(/** @scrutinizer ignore-unused */ User $user, Customer $customer)

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

68
    public function delete(User $user, /** @scrutinizer ignore-unused */ Customer $customer)

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...
69
    {
70
        //
71
    }
72
73
    /**
74
     * Determine whether the user can restore the model.
75
     *
76
     * @param  \App\Models\User  $user
77
     * @param  \App\Models\Customer  $customer
78
     * @return \Illuminate\Auth\Access\Response|bool
79
     */
80
    public function restore(User $user, Customer $customer)
0 ignored issues
show
Unused Code introduced by
The parameter $customer 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

80
    public function restore(User $user, /** @scrutinizer ignore-unused */ Customer $customer)

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

80
    public function restore(/** @scrutinizer ignore-unused */ User $user, Customer $customer)

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

92
    public function forceDelete(User $user, /** @scrutinizer ignore-unused */ Customer $customer)

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

92
    public function forceDelete(/** @scrutinizer ignore-unused */ User $user, Customer $customer)

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...
93
    {
94
        //
95
    }
96
}
97