render() public method

Render method
public render ( boolean $ret = false ) : mixed
$ret boolean
return mixed
Example #1
0
 /**
  * Render method
  *
  * @param  boolean $ret
  * @return mixed
  */
 public function render($ret = false)
 {
     $this->output = '<?php' . PHP_EOL;
     $this->output .= null !== $this->docblock ? $this->docblock->render(true) . PHP_EOL : null;
     if (null !== $this->namespace) {
         $this->output .= $this->namespace->render(true) . PHP_EOL;
     }
     if (null !== $this->code) {
         $this->output .= $this->code->render(true) . PHP_EOL;
     }
     if (null !== $this->body) {
         $this->output .= PHP_EOL . $this->body . PHP_EOL . PHP_EOL;
     }
     if ($this->close) {
         $this->output .= '?>' . PHP_EOL;
     }
     if ($ret) {
         return $this->output;
     } else {
         echo $this->output;
     }
 }