Fix previous merge
This commit is contained in:
parent
7192d29efc
commit
8cb2d296f9
@ -24,10 +24,6 @@ final class UidNormalizer implements NormalizerInterface, DenormalizerInterface,
|
||||
*/
|
||||
public function normalize($object, string $format = null, array $context = [])
|
||||
{
|
||||
if (!$object instanceof AbstractUid) {
|
||||
throw new InvalidArgumentException('The object must be an instance of "Symfony\Component\Uid\AbstractUid".');
|
||||
}
|
||||
|
||||
return (string) $object;
|
||||
}
|
||||
|
||||
@ -45,12 +41,10 @@ final class UidNormalizer implements NormalizerInterface, DenormalizerInterface,
|
||||
public function denormalize($data, string $type, string $format = null, array $context = [])
|
||||
{
|
||||
try {
|
||||
$uid = Ulid::class === $type ? Ulid::fromString($data) : Uuid::fromString($data);
|
||||
return Ulid::class === $type ? Ulid::fromString($data) : Uuid::fromString($data);
|
||||
} catch (\InvalidArgumentException $exception) {
|
||||
throw new NotNormalizableValueException(sprintf('The data is not a valid "%s" string representation.', $type));
|
||||
}
|
||||
|
||||
return $uid;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,6 +34,7 @@
|
||||
"symfony/mime": "^4.4|^5.0",
|
||||
"symfony/property-access": "^4.4|^5.0",
|
||||
"symfony/property-info": "^4.4|^5.0",
|
||||
"symfony/uid": "^5.1",
|
||||
"symfony/validator": "^4.4|^5.0",
|
||||
"symfony/var-exporter": "^4.4|^5.0",
|
||||
"symfony/yaml": "^4.4|^5.0"
|
||||
|
Reference in New Issue
Block a user