vendor/willdurand/hateoas/src/Hateoas.php line 33

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Hateoas;
  4. use Hateoas\Helper\LinkHelper;
  5. use JMS\Serializer\DeserializationContext;
  6. use JMS\Serializer\SerializationContext;
  7. use JMS\Serializer\SerializerInterface;
  8. class Hateoas implements SerializerInterface
  9. {
  10.     /**
  11.      * @var SerializerInterface
  12.      */
  13.     private $serializer;
  14.     /**
  15.      * @var LinkHelper
  16.      */
  17.     private $linkHelper;
  18.     public function __construct(SerializerInterface $serializerLinkHelper $linkHelper)
  19.     {
  20.         $this->serializer $serializer;
  21.         $this->linkHelper $linkHelper;
  22.     }
  23.     /**
  24.      * {@inheritdoc}
  25.      */
  26.     public function serialize($datastring $format, ?SerializationContext $context null, ?string $type null): string
  27.     {
  28.         return $this->serializer->serialize($data$format$context$type);
  29.     }
  30.     /**
  31.      * {@inheritdoc}
  32.      */
  33.     public function deserialize(string $datastring $typestring $format, ?DeserializationContext $context null)
  34.     {
  35.         return $this->serializer->deserialize($data$type$format$context);
  36.     }
  37.     public function getSerializer(): SerializerInterface
  38.     {
  39.         return $this->serializer;
  40.     }
  41.     public function getLinkHelper(): LinkHelper
  42.     {
  43.         return $this->linkHelper;
  44.     }
  45. }