Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function generate($raw = false)
 {
     $writer = new Writer(4, true);
     $writer->setOutputIndentation(1);
     $this->getMethodDeclaration($writer, false);
     $writer->appendln(';');
     return $raw ? $writer : $writer->dump();
 }
Ejemplo n.º 2
0
 /**
  * generate
  *
  * @param boolean $raw
  *
  * @return void
  */
 public function generate($raw = self::RV_STRING)
 {
     $writer = new Writer();
     $writer->setOutputIndentation(1);
     $this->getDoc($writer);
     $writer->setOutputIndentation(1);
     $writer->writeln(sprintf('const %s = %s;', strtoupper($this->name), $this->getValue()));
     return $raw ? $writer : $writer->dump();
 }
Ejemplo n.º 3
0
 /**
  * getBody
  *
  * @return string
  */
 protected function getBody()
 {
     if (null === $this->body) {
         return;
     }
     if ($this->body instanceof Writer) {
         $body = $this->body;
     } else {
         $body = new Writer();
         $body->writeln($this->body);
     }
     $body->setOutputIndentation(0);
     return $body->dump();
 }