Transformer/RecursivePropertySetterTransformer.php
public function transform($value, array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
        $options = $resolver->resolve($options);

        if (null === $value && $options['ignore_null']) {
            return null;
        }

        if ($options['ignore_missing'] && !$this->accessor->isReadable($value, $options['iterator'])) {
            return null;
        }

        $iterable = $this->accessor->getValue($value, $options['iterator']);
        if (!is_iterable($iterable)) {
            throw new TransformerException($options['iterator'], 0, 'Property not an iterable');
        }

        $protertiesToSet = [];
        foreach ($options['set_properties'] as $propertyName => $propertyValuePath) {
            $protertiesValue = null;
            if ($options['ignore_missing'] && !$this->accessor->isReadable($value, $propertyValuePath)) {
                $protertiesValue = null;
            } else {
                $protertiesValue = $this->accessor->getValue($value, $propertyValuePath);
                if (null === $protertiesValue && !$options['ignore_null']) {
                    throw new TransformerException($propertyValuePath, 0, 'Property is null');
                }
            }
            $protertiesToSet[$propertyName] = $protertiesValue;
        }

        foreach ($iterable as &$item) {
            foreach ($protertiesToSet as $protertyName => $propertyValue) {
                try {
                    $this->accessor->setValue($item, $protertyName, $propertyValue);
                } catch (\Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException $e) {
                    if ($item instanceof \stdClass) {
                        $item = (object) array_merge((array) $item, [$protertyName => $propertyValue]);
                    } else {
                        throw $e;
                    }
                }
            }
        }

        return $iterable;
    }
public function transform($value, array $options = [])
    {
        $resolver = new OptionsResolver();
        $this->configureOptions($resolver);
        /** @noinspection ExceptionsAnnotatingAndHandlingInspection */
        $options = $resolver->resolve($options);

        if (null === $value && $options['ignore_null']) {
            return null;
        }

        if ($options['ignore_missing'] && !$this->accessor->isReadable($value, $options['iterator'])) {
            return null;
        }

        $iterable = $this->accessor->getValue($value, $options['iterator']);
        if (!is_iterable($iterable)) {
            throw new TransformerException($options['iterator'], 0, 'Property not an iterable');
        }

        $protertiesToSet = [];
        foreach ($options['set_properties'] as $propertyName => $propertyValuePath) {
            $protertiesValue = null;
            if ($options['ignore_missing'] && !$this->accessor->isReadable($value, $propertyValuePath)) {
                $protertiesValue = null;
            } else {
                $protertiesValue = $this->accessor->getValue($value, $propertyValuePath);
                if (null === $protertiesValue && !$options['ignore_null']) {
                    throw new TransformerException($propertyValuePath, 0, 'Property is null');
                }
            }
            $protertiesToSet[$propertyName] = $protertiesValue;
        }

        foreach ($iterable as &$item) {
            foreach ($protertiesToSet as $protertyName => $propertyValue) {
                try {
                    $this->accessor->setValue($item, $protertyName, $propertyValue);
                } catch (\Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException $e) {
                    if ($item instanceof \stdClass) {
                        $item = (object) array_merge((array) $item, [$protertyName => $propertyValue]);
                    } else {
                        throw $e;
                    }
                }
            }
        }

        return $iterable;
    }
Must return the transformed $value

@param mixed $value
@param array $options

@throws \Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException
@throws \CleverAge\ProcessBundle\Exception\TransformerException
@throws \Symfony\Component\OptionsResolver\Exception\ExceptionInterface
@throws \Symfony\Component\PropertyAccess\Exception\InvalidArgumentException
@throws \Symfony\Component\PropertyAccess\Exception\AccessException
@throws \Symfony\Component\PropertyAccess\Exception\UnexpectedTypeException

@return mixed $value