for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the XabbuhPandaClient package.
*
* (c) Christian Flothmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Xabbuh\PandaClient\Serializer\Symfony;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Serializer as SymfonySerializer;
use Xabbuh\PandaClient\Serializer\SerializerInterface;
/**
* Plugs the Symfony Serializer component into the Panda client.
* @author Christian Flothmann <[email protected]>
class Serializer implements SerializerInterface
{
* @var \Symfony\Component\Serializer\SerializerInterface
private $serializer;
public function __construct()
$this->serializer = new SymfonySerializer(
array(new Normalizer()), array(new JsonEncoder())
);
}
* {@inheritDoc}
public function serialize($data)
return $this->serializer->serialize($data, 'json');
public function deserialize($data, $type)
$fqcn = 'Xabbuh\PandaClient\Model\\'.$type;
return $this->serializer->deserialize($data, $fqcn, 'json');
public static function getCloudSerializer()
return new Serializer();
public static function getEncodingSerializer()
public static function getProfileSerializer()
public static function getVideoSerializer()