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\Serializer\SerializerFactoryInterface;
/**
* Creates serializer instances that use the Symfony Serializer component.
* @author Christian Flothmann <[email protected]>
final class SerializerFactory implements SerializerFactoryInterface
{
private $serializer;
public function __construct(SerializerInterface $serializer = null)
$this->serializer = $serializer ?: Serializer::createSerializer();
}
* {@inheritdoc}
public function createStatementSerializer()
return new StatementSerializer($this->serializer);
public function createStatementResultSerializer()
return new StatementResultSerializer($this->serializer);
public function createActorSerializer()
return new ActorSerializer($this->serializer);
public function createDocumentDataSerializer()
return new DocumentDataSerializer($this->serializer);