Remove now-unnecessary type checks.
This commit is contained in:
parent
217e1b557e
commit
17c032eb17
|
@ -28,7 +28,6 @@ use function count;
|
|||
use function get_class;
|
||||
use function is_array;
|
||||
use function is_object;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
* Unique Entity Validator checks if one or a set of fields contain unique values.
|
||||
|
@ -48,14 +47,6 @@ final class UniqueEntityValidator extends ConstraintValidator
|
|||
throw new UnexpectedTypeException($constraint, UniqueEntity::class);
|
||||
}
|
||||
|
||||
if (!is_array($constraint->fields) && !is_string($constraint->fields)) {
|
||||
throw new UnexpectedTypeException($constraint->fields, 'array');
|
||||
}
|
||||
|
||||
if (null !== $constraint->errorPath && !is_string($constraint->errorPath)) {
|
||||
throw new UnexpectedTypeException($constraint->errorPath, 'string or null');
|
||||
}
|
||||
|
||||
$fields = (array)$constraint->fields;
|
||||
|
||||
if (0 === count($fields)) {
|
||||
|
|
Loading…
Reference in New Issue