| Total Complexity | 7 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class TasksPolicy |
||
| 12 | { |
||
| 13 | use HandlesAuthorization; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Determine whether the user can view the tasks. |
||
| 17 | * |
||
| 18 | * @param \TaskManager\User $user |
||
| 19 | * @param \TaskManager\Tasks $tasks |
||
| 20 | * @return mixed |
||
| 21 | */ |
||
| 22 | public function view(User $user, Tasks $tasks) |
||
|
|
|||
| 23 | { |
||
| 24 | return dd($tasks); |
||
| 25 | |||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Determine whether the user can create tasks. |
||
| 30 | * |
||
| 31 | * @param \TaskManager\User $user |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | public function create(User $user) |
||
| 35 | { |
||
| 36 | if ($user->active) |
||
| 37 | return true; |
||
| 38 | |||
| 39 | else |
||
| 40 | return false; |
||
| 41 | } |
||
| 42 | |||
| 43 | |||
| 44 | /** |
||
| 45 | * Determine whether the user can update the tasks. |
||
| 46 | * |
||
| 47 | * @param \TaskManager\User $user |
||
| 48 | * @param \TaskManager\Tasks $tasks |
||
| 49 | * @return mixed |
||
| 50 | */ |
||
| 51 | public function update(User $user, Tasks $task) |
||
| 58 | } |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Determine whether the user can delete the tasks. |
||
| 63 | * |
||
| 64 | * @param \TaskManager\User $user |
||
| 65 | * @param Tasks $id |
||
| 66 | * @return mixed |
||
| 67 | * @internal param Tasks $tasks |
||
| 68 | */ |
||
| 69 | public function delete(User $user, Tasks $id) |
||
| 81 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.