| Total Complexity | 9 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class InListGuard implements Guard |
||
| 11 | { |
||
| 12 | use ErrorMessagesBase; |
||
| 13 | use SingleInput; |
||
| 14 | use Strict; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var iterable |
||
| 18 | */ |
||
| 19 | private $list; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * InListVal constructor. |
||
| 23 | * |
||
| 24 | * @param mixed $input |
||
| 25 | * @param iterable $list |
||
| 26 | * @param mixed|null $defaultValue |
||
| 27 | * @param bool $defaultStrict |
||
| 28 | * |
||
| 29 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
| 30 | */ |
||
| 31 | 17 | public function __construct($input, iterable $list, $defaultValue = null, bool $defaultStrict = true) |
|
| 37 | 17 | } |
|
| 38 | |||
| 39 | 17 | public function value() |
|
| 40 | { |
||
| 41 | 17 | $this->success(); |
|
| 42 | |||
| 43 | 17 | return $this->value; |
|
| 44 | } |
||
| 45 | |||
| 46 | 17 | protected function validation($input, &$value): bool |
|
| 76 | } |
||
| 77 | } |
||
| 78 |