/** * @see Patgod85\Phpdoc2rst\Command\Process\Element.Element::__toString() */ public function __toString() { $string = ''; if ($this->reflection->getDocComment()) { $string = sprintf(".. php:const:: %s\n\n", $this->reflection->getName()); $parser = $this->getParser(); if ($parser->hasDescription()) { $description = $parser->getDescription(); if ($description) { $string .= "\n\n"; $string .= $this->indent($description, 4); } } } return $string; }
/** * @param IReflectionConstant $constant * * @return string */ public function writeElement(IReflectionConstant $constant) { return $this->formatLine('+{static}' . $constant->getName() . ' = ' . $this->formatValue($constant->getValue())); }