1 | <?php |
||||||
2 | |||||||
3 | namespace Adminetic\Contact\Policies; |
||||||
4 | |||||||
5 | use App\Models\User; |
||||||
0 ignored issues
–
show
|
|||||||
6 | use Adminetic\Contact\Models\Admin\Group; |
||||||
7 | use Illuminate\Auth\Access\HandlesAuthorization; |
||||||
8 | |||||||
9 | class GroupPolicy |
||||||
10 | { |
||||||
11 | use HandlesAuthorization; |
||||||
12 | |||||||
13 | public function before($user, $ability) |
||||||
0 ignored issues
–
show
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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
14 | { |
||||||
15 | if ($user->isSuperAdmin()) { |
||||||
16 | return true; |
||||||
17 | } |
||||||
18 | } |
||||||
19 | |||||||
20 | |||||||
21 | /** |
||||||
22 | * Determine whether the user can view any models. |
||||||
23 | * |
||||||
24 | * @param \App\Models\User $user |
||||||
25 | * @return mixed |
||||||
26 | */ |
||||||
27 | public function viewAny(User $user) |
||||||
28 | { |
||||||
29 | return $user->userCanDo('Group', 'browse'); |
||||||
30 | } |
||||||
31 | |||||||
32 | /** |
||||||
33 | * Determine whether the user can view the model. |
||||||
34 | * |
||||||
35 | * @param \App\Models\User $user |
||||||
36 | * @param \Adminetic\Contact\Models\Admin\Group $group |
||||||
37 | * @return mixed |
||||||
38 | */ |
||||||
39 | public function view(User $user, Group $group) |
||||||
0 ignored issues
–
show
The parameter
$group 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
40 | { |
||||||
41 | return $user->userCanDo('Group', 'read'); |
||||||
42 | } |
||||||
43 | |||||||
44 | /** |
||||||
45 | * Determine whether the user can create models. |
||||||
46 | * |
||||||
47 | * @param \App\Models\User $user |
||||||
48 | * @return mixed |
||||||
49 | */ |
||||||
50 | public function create(User $user) |
||||||
51 | { |
||||||
52 | return $user->userCanDo('Group', 'add'); |
||||||
53 | } |
||||||
54 | |||||||
55 | /** |
||||||
56 | * Determine whether the user can update the model. |
||||||
57 | * |
||||||
58 | * @param \App\Models\User $user |
||||||
59 | * @param \Adminetic\Contact\Models\Admin\Group $group |
||||||
60 | * @return mixed |
||||||
61 | */ |
||||||
62 | public function update(User $user, Group $group) |
||||||
0 ignored issues
–
show
The parameter
$group 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
63 | { |
||||||
64 | return $user->userCanDo('Group', 'edit'); |
||||||
65 | } |
||||||
66 | |||||||
67 | /** |
||||||
68 | * Determine whether the user can delete the model. |
||||||
69 | * |
||||||
70 | * @param \App\Models\User $user |
||||||
71 | * @param \Adminetic\Contact\Models\Admin\Group $group |
||||||
72 | * @return mixed |
||||||
73 | */ |
||||||
74 | public function delete(User $user, Group $group) |
||||||
0 ignored issues
–
show
The parameter
$group 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
75 | { |
||||||
76 | return $user->userCanDo('Group', 'delete'); |
||||||
77 | } |
||||||
78 | |||||||
79 | /** |
||||||
80 | * Determine whether the user can restore the model. |
||||||
81 | * |
||||||
82 | * @param \App\Models\User $user |
||||||
83 | * @param \Adminetic\Contact\Models\Admin\Group $group |
||||||
84 | * @return mixed |
||||||
85 | */ |
||||||
86 | public function restore(User $user, Group $group) |
||||||
0 ignored issues
–
show
The parameter
$group 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
87 | { |
||||||
88 | return true; |
||||||
89 | } |
||||||
90 | |||||||
91 | /** |
||||||
92 | * Determine whether the user can permanently delete the model. |
||||||
93 | * |
||||||
94 | * @param \App\Models\User $user |
||||||
95 | * @param \Adminetic\Contact\Models\Admin\Group $group |
||||||
96 | * @return mixed |
||||||
97 | */ |
||||||
98 | public function forceDelete(User $user, Group $group) |
||||||
0 ignored issues
–
show
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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() The parameter
$group 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
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. ![]() |
|||||||
99 | { |
||||||
100 | return true; |
||||||
101 | } |
||||||
102 | } |
||||||
103 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths