for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the xAPI 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\XApi\Serializer;
use Symfony\Component\Serializer\SerializerInterface;
use Xabbuh\XApi\Model\Actor;
/**
* Serialize and deserialize {@link Actor actors}.
* @author Christian Flothmann <[email protected]>
class ActorSerializer implements ActorSerializerInterface
{
* @var SerializerInterface
private $serializer;
public function __construct(SerializerInterface $serializer)
$this->serializer = $serializer;
}
* {@inheritDoc}
public function serializeActor(Actor $actor)
return $this->serializer->serialize($actor, 'json');
public function deserializeActor($data)
return $this->serializer->deserialize($data, 'Xabbuh\XApi\Model\Actor', 'json');