public function getParameter($id) { if (!array_key_exists($id, $this->parameters)) { throw new \RuntimeException(sprintf("Service container does not have parameter with id \"%s\"", $id)); } return $this->parameters[$id]; }
/** * If value is valid string between "%" characters then it might be a parameter * so we need to try take it from container. * * @param $value * @return mixed */ private function getValue($value) { if (!is_string($value)) { return $value; } if ($value[0] != '%' || $value[strlen($value) - 1] != '%') { return $value; } $parameter = trim($value, '%'); if ($this->container->hasParameter($parameter)) { return $this->container->getParameter($parameter); } return $value; }