urlResolver = $urlResolver; $this->paramsInterpreter = $paramsInterpreter; } /** * {@inheritdoc} * @return string * @throws \InvalidArgumentException */ public function evaluate(array $data) { if (!isset($data['path'])) { throw new \InvalidArgumentException('URL path is missing.'); } $urlPath = $data['path']; $urlParams = $this->paramsInterpreter->evaluate($data); return $this->urlResolver->getUrl($urlPath, $urlParams); } }