/** * {@inheritdoc} */ public function process(Config $config) { $map = $this->getMap(); $data = $config->getData(); \array_walk_recursive($data, function (&$v, $k) use($map) { $v = \strtr($v, $map); }); $config->setData($data); return $config; }
/** * {@inheritdoc} */ public function process(Config $config) { $data = $config->getData(); $propertyAccessor = \Symfony\Component\PropertyAccess\PropertyAccess::createPropertyAccessor(); $flatten = array(); $this->flattenArray($data, $flatten); $parameters = array(); foreach ($flatten as $k => $v) { $parameters[$k] = $v['value']; } $this->clear(); $this->add($parameters); $this->resolved = false; $this->resolve(); $parameters = $this->all(); foreach ($parameters as $k => $v) { if ($v === $flatten[$k]['value']) { continue; } $propertyAccessor->setValue($data, $flatten[$k]['path'], $v); } $config->setData($data); return $config; }