hetzner-dns-api/generated/Runtime/Normalizer/ReferenceNormalizer.php

25 lines
623 B
PHP
Raw Normal View History

2023-01-05 12:55:52 +01:00
<?php
namespace DigiComp\HetznerDnsApi\Runtime\Normalizer;
use Jane\Component\JsonSchemaRuntime\Reference;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
class ReferenceNormalizer implements NormalizerInterface
{
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = [])
{
$ref = [];
$ref['$ref'] = (string) $object->getReferenceUri();
return $ref;
}
/**
* {@inheritdoc}
*/
public function supportsNormalization($data, $format = null) : bool
{
return $data instanceof Reference;
}
}