/** * {@inheritDoc} */ public function loadMetadata(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $method) { $key = 'parameter.converter.orm.metadata:'; $key .= KeyGenerator::generateForParameter($parameter, $method); $metadata = $this->cache->get($key); if (null === $metadata) { $metadata = $this->delegate->loadMetadata($parameter, $method); $this->cache->set($key, $metadata); } return $metadata; }
/** * {@inheritDoc} */ public function convert(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $method, $value, array $attributes = []) { $metadata = $this->reader->loadMetadata($parameter, $method); if (!$value && $metadata->getValue()) { $value = $metadata->getValue(); if (is_array($value)) { foreach ($value as $key => $childValue) { $value[$key] = $this->evaluateValue($childValue, $attributes); } } else { $value = $this->evaluateValue($value, $attributes); } } return $this->convertValue($metadata, $value, false); }