| Total Complexity | 4 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | class UserBelongsToGroup implements Rule |
||
| 17 | { |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var Authentication |
||
| 21 | */ |
||
| 22 | private $authentication; |
||
| 23 | /** |
||
| 24 | * @var UserRepository |
||
| 25 | */ |
||
| 26 | private $userRepository; |
||
| 27 | |||
| 28 | 7 | public function __construct(Authentication $authentication, UserRepository $userRepository) |
|
| 32 | 7 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * @inheritDoc |
||
| 36 | */ |
||
| 37 | 7 | public function passes($attribute, $value) |
|
| 44 | } |
||
| 45 | |||
| 46 | 7 | protected function group() |
|
| 47 | { |
||
| 48 | 7 | return $this->authentication->getGroup(); |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @inheritDoc |
||
| 53 | */ |
||
| 54 | 1 | public function message() |
|
| 57 | } |
||
| 58 | } |