We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Total Complexity | 7 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class Optional extends AbstractWrapper |
||
| 20 | { |
||
| 21 | use UndefinedHelper; |
||
| 22 | |||
| 23 | 22 | public function __construct(Validatable $rule) |
|
| 24 | { |
||
| 25 | 22 | $this->validatable = $rule; |
|
| 26 | 22 | } |
|
| 27 | |||
| 28 | 2 | public function assert($input) |
|
| 35 | } |
||
| 36 | |||
| 37 | 2 | public function check($input) |
|
| 38 | { |
||
| 39 | 2 | if ($this->isUndefined($input)) { |
|
| 40 | 1 | return true; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | return parent::check($input); |
|
| 44 | } |
||
| 45 | |||
| 46 | 17 | public function validate($input) |
|
| 53 | } |
||
| 54 | } |
||
| 55 |