Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74235ab

Browse filesBrowse files
author
Guillaume Pédelagrabe
committed
Check if AbstractUid class exists.
1 parent 19d4558 commit 74235ab
Copy full SHA for 74235ab

File tree

1 file changed

+5
-0
lines changed
Filter options

1 file changed

+5
-0
lines changed

‎src/Symfony/Component/Serializer/Normalizer/UidNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/UidNormalizer.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
15+
use Symfony\Component\Serializer\Exception\LogicException;
1516
use Symfony\Component\Serializer\Exception\NotNormalizableValueException;
1617
use Symfony\Component\Uid\AbstractUid;
1718
use Symfony\Component\Uid\Ulid;
@@ -48,6 +49,10 @@ public function supportsNormalization($data, string $format = null)
4849
*/
4950
public function denormalize($data, string $type, string $format = null, array $context = [])
5051
{
52+
if (!class_exists(AbstractUid::class)) {
53+
throw new LogicException('Unable to execute this command as the Symfony Uid Component is not installed.');
54+
}
55+
5156
try {
5257
$uid = Ulid::class === $type ? Ulid::fromString($data) : Uuid::fromString($data);
5358
} catch (\InvalidArgumentException $exception) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.