| Total Complexity | 14 |
| Total Lines | 71 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class ScriptsSectionModelPolicy |
||
| 11 | { |
||
| 12 | use HandlesAuthorization; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @param User $user |
||
| 16 | * @param string $ability |
||
| 17 | * @param Scripts $section |
||
| 18 | * @param Script $item |
||
| 19 | * |
||
| 20 | * @return bool |
||
| 21 | */ |
||
| 22 | public function before(User $user, $ability, Section $section, Model $item = null) |
||
| 23 | { |
||
| 24 | if ($user->isAdmin()) { |
||
| 25 | return true; |
||
| 26 | } |
||
| 27 | } |
||
| 28 | |||
| 29 | public function display(User $user, Section $section, Model $item) |
||
| 36 | } |
||
| 37 | |||
| 38 | public function create(User $user, Section $section, Model $item) |
||
| 45 | } |
||
| 46 | |||
| 47 | public function edit(User $user, Section $section, Model $item) |
||
| 48 | { |
||
| 49 | if ($user->isAdmin()) { |
||
| 50 | return true; |
||
| 51 | } |
||
| 52 | |||
| 53 | return false; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function delete(User $user, Section $section, Model $item) |
||
| 57 | { |
||
| 58 | if ($user->isAdmin()) { |
||
| 59 | return true; |
||
| 60 | } |
||
| 61 | |||
| 62 | return false; |
||
| 63 | } |
||
| 64 | |||
| 65 | public function restore(User $user, Section $section, Model $item) |
||
| 66 | { |
||
| 67 | if ($user->isAdmin()) { |
||
| 68 | return true; |
||
| 69 | } |
||
| 70 | |||
| 71 | return false; |
||
| 72 | } |
||
| 73 | |||
| 74 | public function destroy(User $user, Section $section, Model $item) |
||
| 81 | } |
||
| 82 | } |
||
| 83 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.