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

Commit 002f817

Browse files
committed
Tune NonEmpty validator
1 parent 1cacb3e commit 002f817

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/Input.php

+10-2
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,21 @@ protected function injectNotEmptyValidator()
466466
}
467467

468468
$this->notEmptyValidator = true;
469+
$options = [
470+
'type' => [
471+
NotEmpty::NULL |
472+
NotEmpty::STRING |
473+
NotEmpty::EMPTY_ARRAY |
474+
NotEmpty::OBJECT
475+
],
476+
];
469477

470478
if (class_exists(AbstractPluginManager::class)) {
471-
$chain->prependByName('NotEmpty', [], true);
479+
$chain->prependByName('NotEmpty', $options, true);
472480

473481
return;
474482
}
475483

476-
$chain->prependValidator(new NotEmpty(), true);
484+
$chain->prependValidator(new NotEmpty($options), true);
477485
}
478486
}

0 commit comments

Comments
 (0)