setValueParser($valueParser); } /** * @inheritDoc */ public function parse (array $args): ?ParseResult { try { if (!$this->_parseTag($args[0])) { return null; } if (count($args) < 2 || is_null($args[1])) { throw new IncorrectParse('La seconde valeur de l\'argument manquante'); } return new ParseResult($this->valueParser->parseValue($args[1]), 2); } catch (RuntimeException $e) { throw new IncorrectParse('Échec du parsage de la valeur "' . $args[0] . '"', 0, $e); } } /** * @inheritDoc */ public function getValueDescription (): string { return $this->valueParser->getValueDescription(); } /** * Le parseur de valeur. * * @return IValueParser Le parseur. * * @see $valueParser * * @noinspection PhpUnused */ public function getValueParser (): IValueParser { return $this->valueParser; } /** * Définit le parseur de valeur * * @param IValueParser $valueParser Le parseur * * @return $this * * @see $valueParser */ public function setValueParser (IValueParser $valueParser): self { $this->valueParser = $valueParser; return $this; } }