Skip to content

Commit de8a395

Browse files
committed
mhh
1 parent 0f8509c commit de8a395

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Serializer/ItemNormalizer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
namespace ApiPlatform\Serializer;
1515

16-
use ApiPlatform\Exception\InvalidArgumentException;
16+
use ApiPlatform\Exception\InvalidArgumentException as LegacyInvalidArgumentException;
17+
use ApiPlatform\Metadata\Exception\InvalidArgumentException;
1718
use ApiPlatform\Metadata\IriConverterInterface;
1819
use ApiPlatform\Metadata\Link;
1920
use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface;
@@ -75,7 +76,7 @@ private function updateObjectToPopulate(array $data, array &$context): void
7576
{
7677
try {
7778
$context[self::OBJECT_TO_POPULATE] = $this->iriConverter->getResourceFromIri((string) $data['id'], $context + ['fetch_data' => true]);
78-
} catch (InvalidArgumentException) {
79+
} catch (LegacyInvalidArgumentException|InvalidArgumentException) {
7980
$operation = $this->resourceMetadataCollectionFactory->create($context['resource_class'])->getOperation();
8081
$uriVariables = $this->getContextUriVariables($data, $operation, $context);
8182
$iri = $this->iriConverter->getIriFromResource($context['resource_class'], UrlGeneratorInterface::ABS_PATH, $operation, ['uri_variables' => $uriVariables]);

0 commit comments

Comments
 (0)