Fixed type error introduced with api-platform upgrade

This commit is contained in:
Jan Böhmer 2025-02-22 19:59:12 +01:00
parent 17caf476bf
commit a54c2db9b9

View file

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace App\Serializer\APIPlatform; namespace App\Serializer\APIPlatform;
use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException; use ApiPlatform\Metadata\Exception\ResourceClassNotFoundException;
use ApiPlatform\Api\IriConverterInterface; use ApiPlatform\Metadata\IriConverterInterface;
use ApiPlatform\Metadata\Operation; use ApiPlatform\Metadata\Operation;
use ApiPlatform\Metadata\Post; use ApiPlatform\Metadata\Post;
use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface; use ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface;
@ -60,7 +60,6 @@ class DetermineTypeFromElementIRIDenormalizer implements DenormalizerInterface,
* @param array $input * @param array $input
* @param Operation $operation * @param Operation $operation
* @return array * @return array
* @throws ResourceClassNotFoundException
*/ */
private function addTypeDiscriminatorIfNecessary(array $input, Operation $operation): array private function addTypeDiscriminatorIfNecessary(array $input, Operation $operation): array
{ {
@ -81,6 +80,7 @@ class DetermineTypeFromElementIRIDenormalizer implements DenormalizerInterface,
} }
//Retrieve the element //Retrieve the element
//@phpstan-ignore-next-line
$element = $this->iriConverter->getResourceFromIri($input['element']); $element = $this->iriConverter->getResourceFromIri($input['element']);
//Retrieve the short name of the operation //Retrieve the short name of the operation