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\Normalizer;
use Xabbuh\XApi\Model\IRL;
/**
* Normalizes and denormalizes internationalized resource locators.
* @author Christian Flothmann <[email protected]>
final class IrlNormalizer extends Normalizer
{
* {@inheritdoc}
public function normalize($object, $format = null, array $context = array())
if (!$object instanceof IRL) {
return;
}
return $object->getValue();
public function supportsNormalization($data, $format = null)
return $data instanceof IRL;
public function denormalize($data, $class, $format = null, array $context = array())
return IRL::fromString($data);
public function supportsDenormalization($data, $type, $format = null)
return 'Xabbuh\XApi\Model\IRL' === $type;