Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3.2098 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
43 | 7 | public function passes($attribute, $value) |
|
44 | { |
||
45 | try { |
||
46 | 7 | $settings = $this->positionSettingRetrieval->getSettings($this->group()); |
|
47 | } catch (\Exception $e) { |
||
48 | return false; |
||
49 | } |
||
50 | 7 | if(in_array($value, $settings['only_one_user'])) { |
|
51 | 2 | return $this->roleRepository->getById($value)->users()->count() === 0; |
|
52 | } |
||
53 | 5 | return true; |
|
54 | } |
||
68 | } |