Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| In | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace Engelsystem\Http\Validation\Rules; |
| 6 | |
| 7 | use Respect\Validation\Rules\Core\Envelope; |
| 8 | use Respect\Validation\Rules\In as RespectIn; |
| 9 | |
| 10 | class In extends Envelope |
| 11 | { |
| 12 | public function __construct(mixed $haystack, bool $compareIdentical = false) |
| 13 | { |
| 14 | if (!is_array($haystack)) { |
| 15 | $haystack = explode(',', $haystack); |
| 16 | } |
| 17 | |
| 18 | parent::__construct(new RespectIn($haystack, $compareIdentical)); |
| 19 | } |
| 20 | } |