for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the puli/repository package.
*
* (c) Bernhard Schussek <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Puli\Repository\ChangeStream\Normalizer;
use Puli\Repository\Api\Resource\PuliResource;
use Puli\Repository\Resource\GenericResource;
/**
* Normalizer for generic resources.
* @since 1.0
* @author Titouan Galopin <[email protected]>
class GenericResourceNormalizer implements ResourceNormalizer
{
* {@inheritdoc}
public function normalize(PuliResource $resource)
$data = array();
$data['path'] = $resource->getPath();
return $data;
}
public function denormalize($data)
return new GenericResource($data['path']);
public function supports(PuliResource $resource)
return $resource instanceof GenericResource;