for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Ivory Serializer package.
*
* (c) Eric GELOEN <[email protected]>
* For the full copyright and license information, please read the LICENSE
* file that was distributed with this source code.
*/
namespace Ivory\Serializer\Accessor;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
/**
* @author GeLo <[email protected]>
class SymfonyAccessor implements AccessorInterface
{
* @var PropertyAccessorInterface
private $propertyAccessor;
* @param PropertyAccessorInterface|null $propertyAccessor
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
* {@inheritdoc}
public function getValue($object, $property)
return $this->propertyAccessor->getValue($object, $property);