Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit b79b531

Browse files
committed
Tune NonEmpty validator
1 parent 50f987b commit b79b531

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Input.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,13 +472,21 @@ protected function injectNotEmptyValidator()
472472
}
473473

474474
$this->notEmptyValidator = true;
475+
$options = [
476+
'type' => [
477+
NotEmpty::NULL |
478+
NotEmpty::STRING |
479+
NotEmpty::EMPTY_ARRAY |
480+
NotEmpty::OBJECT
481+
],
482+
];
475483

476484
if (class_exists(AbstractPluginManager::class)) {
477-
$chain->prependByName('NotEmpty', [], true);
485+
$chain->prependByName('NotEmpty', $options, true);
478486

479487
return;
480488
}
481489

482-
$chain->prependValidator(new NotEmpty(), true);
490+
$chain->prependValidator(new NotEmpty($options), true);
483491
}
484492
}

0 commit comments

Comments
 (0)