| Total Complexity | 4 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 8 | class BlogCommentPolicy |
||
| 9 | { |
||
| 10 | use HandlesAuthorization; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Authorize all actions if the user has the given permission. |
||
| 14 | * |
||
| 15 | * @param \Xetaravel\Models\User $user |
||
| 16 | * @param string $ability |
||
| 17 | * |
||
| 18 | * @return true|void |
||
| 19 | */ |
||
| 20 | public function before(User $user, string $ability) |
||
| 24 | } |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Determine whether the user can update the discuss post. |
||
| 29 | * |
||
| 30 | * @param \Xetaravel\Models\User $user |
||
| 31 | * @param \Xetaravel\Models\Comment $comment |
||
| 32 | * |
||
| 33 | * @return bool |
||
| 34 | */ |
||
| 35 | public function update(User $user, Comment $comment) |
||
| 36 | { |
||
| 37 | return $user->id === $comment->user_id; |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Determine whether the user can delete the discuss post. |
||
| 42 | * |
||
| 43 | * @param \Xetaravel\Models\User $user |
||
| 44 | * @param \Xetaravel\Models\Comment $comment |
||
| 45 | * |
||
| 46 | * @return bool |
||
| 47 | */ |
||
| 48 | public function delete(User $user, Comment $comment) |
||
| 51 | } |
||
| 52 | } |
||
| 53 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.