src/Core/Serializer/Normalizer/IdentityNormalizer.php line 27
<?phpdeclare(strict_types=1);namespace App\Core\Serializer\Normalizer;use App\Component\Identity\Encoder\IdEncoderInterface;use App\Component\Identity\IdInterface;use Symfony\Component\Serializer\Normalizer\CacheableSupportsMethodInterface;use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;use Symfony\Component\Serializer\Normalizer\NormalizerInterface;final class IdentityNormalizer implements NormalizerInterface, DenormalizerInterface, CacheableSupportsMethodInterface{private IdEncoderInterface $encoder;public function __construct(IdEncoderInterface $encoder){$this->encoder = $encoder;}public function normalize($object, string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null{return $this->encoder->encode($object);}public function supportsNormalization($data, string $format = null): bool{return true === $data instanceof IdInterface;}public function denormalize($data, string $type, string $format = null, array $context = []): IdInterface{/* @var $type IdInterface */return $type::createFromString($data);}public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool{return true === is_subclass_of($type, IdInterface::class);}public function hasCacheableSupportsMethod(): bool{return __CLASS__ === self::class;}}