Skip to content

Commit

Permalink
Validator empty
Browse files Browse the repository at this point in the history
  • Loading branch information
hsnfirdaus committed Jun 14, 2023
1 parent ad8bb74 commit 46845c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function validate(object $object, array $config = ['language' => I
/** @param list<string, mixed> $config */
private static function validateProperty(ReflectionProperty $property, object $object, array $config): void
{
if (! $property->isInitialized($object)) {
if (! $property->isInitialized($object) || $property->getValue($object) === '' || $property->getValue($object) === null) {
if (! $property->getAttributes(IsOptional::class)) {
throw new PropertyError($property, 'NOT_EMPTY', $config);
}
Expand Down

0 comments on commit 46845c2

Please sign in to comment.