1 | <?php namespace Arcanesoft\Auth\Providers; |
||
13 | class AuthorizationServiceProvider extends ServiceProvider |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Properties |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * The policy mappings for the application. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $policies = [ |
||
25 | // |
||
26 | ]; |
||
27 | |||
28 | /* ------------------------------------------------------------------------------------------------ |
||
29 | | Main Functions |
||
30 | | ------------------------------------------------------------------------------------------------ |
||
31 | */ |
||
32 | /** |
||
33 | * Register any application authentication / authorization services. |
||
34 | * |
||
35 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
36 | */ |
||
37 | 12 | public function boot(GateContract $gate) |
|
38 | { |
||
39 | 12 | parent::registerPolicies(); |
|
|
|||
40 | |||
41 | 12 | $this->registerDashboardPolicies($gate); |
|
42 | 12 | $this->registerUsersPolicies($gate); |
|
43 | 12 | $this->registerRolesPolicies($gate); |
|
44 | 12 | $this->registerPermissionsPolicies($gate); |
|
45 | 12 | $this->registerPasswordResetsPolicies($gate); |
|
46 | 12 | } |
|
47 | |||
48 | /* ------------------------------------------------------------------------------------------------ |
||
49 | | Policies |
||
50 | | ------------------------------------------------------------------------------------------------ |
||
51 | */ |
||
52 | /** |
||
53 | * Register dashboard authorizations. |
||
54 | * |
||
55 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
56 | */ |
||
57 | 12 | private function registerDashboardPolicies($gate) |
|
64 | |||
65 | /** |
||
66 | * Register users authorizations. |
||
67 | * |
||
68 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
69 | */ |
||
70 | 12 | private function registerUsersPolicies(GateContract $gate) |
|
77 | |||
78 | /** |
||
79 | * Register roles authorizations. |
||
80 | * |
||
81 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
82 | */ |
||
83 | 12 | private function registerRolesPolicies(GateContract $gate) |
|
90 | |||
91 | /** |
||
92 | * Register permissions authorizations. |
||
93 | * |
||
94 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
95 | */ |
||
96 | 12 | private function registerPermissionsPolicies(GateContract $gate) |
|
103 | |||
104 | /** |
||
105 | * Register password resets authorizations. |
||
106 | * |
||
107 | * @param \Illuminate\Contracts\Auth\Access\Gate $gate |
||
108 | */ |
||
109 | 12 | private function registerPasswordResetsPolicies(GateContract $gate) |
|
116 | } |
||
117 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()
method in theSon
calls the wrong method in the parent class.