Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
22 | protected function validateValue($value) |
||
23 | { |
||
24 | if (!is_array($value)) { |
||
25 | return [Yii::t('usuario', 'Invalid value'), []]; |
||
26 | } |
||
27 | |||
28 | foreach ($value as $item) { |
||
29 | if ($this->getAuthManager()->getItem($item) === null) { |
||
30 | return [Yii::t('usuario', 'There is neither role nor permission with name "{0}"', [$item]), []]; |
||
31 | } |
||
32 | } |
||
33 | } |
||
34 | } |
||
35 |