RakshakSettingPolicy   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 67
rs 10
c 0
b 0
f 0
wmc 7

6 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 3 1
A create() 0 3 1
A delete() 0 3 1
A view() 0 3 1
A before() 0 4 2
A update() 0 3 1
1
<?php
2
3
namespace Thinkstudeo\Rakshak\Policies;
4
5
use App\User;
0 ignored issues
show
Bug introduced by
The type App\User was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Illuminate\Auth\Access\HandlesAuthorization;
7
use Thinkstudeo\Rakshak\RakshakSetting;
8
9
class RakshakSettingPolicy
10
{
11
    use HandlesAuthorization;
12
13
    public function before($user, $setting)
0 ignored issues
show
Unused Code introduced by
The parameter $setting 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

13
    public function before($user, /** @scrutinizer ignore-unused */ $setting)

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...
14
    {
15
        if ($user->isSuperUser()) {
16
            return true;
17
        }
18
    }
19
20
    /**
21
     * Determine whether the user can view the listing of Abilities.
22
     *
23
     * @param  \App\User  $user
24
     * @return mixed
25
     */
26
    public function index(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

26
    public function index(/** @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...
27
    {
28
        return false;
29
    }
30
31
    /**
32
     * Determine whether the user can view the role.
33
     *
34
     * @param  \App\User  $user
35
     * @param  \Thinkstudeo\Rakshak\RakshakSetting  $setting
36
     * @return mixed
37
     */
38
    public function view(User $user, RakshakSetting $setting)
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

38
    public function view(/** @scrutinizer ignore-unused */ User $user, RakshakSetting $setting)

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 $setting 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 view(User $user, /** @scrutinizer ignore-unused */ RakshakSetting $setting)

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
        return false;
41
    }
42
43
    /**
44
     * Determine whether the user can create roles.
45
     *
46
     * @param  \App\User $user
47
     * @return mixed
48
     */
49
    public function create(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

49
    public function create(/** @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...
50
    {
51
        return false;
52
    }
53
54
    /**
55
     * Determine whether the user can update the role.
56
     *
57
     * @param  \App\User  $user
58
     * @param  \Thinkstudeo\Rakshak\RakshakSetting  $setting
59
     * @return mixed
60
     */
61
    public function update(User $user, RakshakSetting $setting)
0 ignored issues
show
Unused Code introduced by
The parameter $setting 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 */ RakshakSetting $setting)

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

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

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 false;
64
    }
65
66
    /**
67
     * Determine whether the user can delete the role.
68
     *
69
     * @param  \App\User  $user
70
     * @param  \Thinkstudeo\Rakshak\RakshakSetting  $setting
71
     * @return mixed
72
     */
73
    public function delete(User $user, RakshakSetting $setting)
0 ignored issues
show
Unused Code introduced by
The parameter $setting 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 */ RakshakSetting $setting)

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

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

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 false;
76
    }
77
}
78