| Total Complexity | 5 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | final class NullType implements Type |
||
| 10 | { |
||
| 11 | /** @var \Spatie\Typed\Type */ |
||
| 12 | private $type; |
||
| 13 | |||
| 14 | public function __construct(Type $type) |
||
| 17 | } |
||
| 18 | |||
| 19 | public function validate($value) |
||
| 20 | { |
||
| 21 | if ($value === null) { |
||
| 22 | return; |
||
| 23 | } |
||
| 24 | |||
| 25 | return $this->type->validate($value); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getType(): Type |
||
| 29 | { |
||
| 30 | return $this->type; |
||
| 31 | } |
||
| 32 | |||
| 33 | public function nullable(): self |
||
| 36 | } |
||
| 37 | } |
||
| 38 |