| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Anomaly\UsersModule\User\Command; |
||
| 43 | public function handle(RoleRepositoryInterface $roles, Guard $guard) |
||
| 44 | { |
||
| 45 | /* @var UserInterface $user */ |
||
| 46 | if (!$user = $guard->user()) { |
||
| 47 | return false; |
||
| 48 | } |
||
| 49 | |||
| 50 | if (is_numeric($this->identifier)) { |
||
| 51 | return $user->hasRole($roles->find($this->identifier)); |
||
| 52 | } |
||
| 53 | |||
| 54 | if (is_string($this->identifier)) { |
||
| 55 | return $user->hasRole($roles->findBySlug($this->identifier)); |
||
| 56 | } |
||
| 57 | |||
| 58 | return false; |
||
| 59 | } |
||
| 60 | } |
||
| 61 |