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\Mutator;
use Symfony\Component\PropertyAccess\PropertyAccess;
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
/**
* @author GeLo <[email protected]>
class SymfonyMutator implements MutatorInterface
{
* @var PropertyAccessorInterface
private $propertyAccessor;
* @param PropertyAccessorInterface|null $propertyAccessor
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
$this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
* {@inheritdoc}
public function setValue($object, $property, $value)
$this->propertyAccessor->setValue($object, $property, $value);