for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Chubbyphp\Deserialization\Denormalizer;
use Chubbyphp\Deserialization\Accessor\AccessorInterface;
final class FieldDenormalizer implements FieldDenormalizerInterface
{
/**
* @var AccessorInterface
*/
private $accessor;
* @var mixed
private $default;
public function __construct(AccessorInterface $accessor, $default = null)
$this->accessor = $accessor;
$this->default = $default;
}
* @param string $path
* @param object $object
* @param mixed $value
* @param DenormalizerContextInterface $context
* @param DenormalizerInterface|null $denormalizer
public function denormalizeField(
string $path,
$object,
$value,
DenormalizerContextInterface $context,
DenormalizerInterface $denormalizer = null
) {
$this->accessor->setValue($object, $value);