/** * Render interface * * @param boolean $ret * @return mixed */ public function render($ret = false) { $this->output = null !== $this->namespace ? $this->namespace->render(true) . PHP_EOL : null; $this->output .= null !== $this->docblock ? $this->docblock->render(true) : null; $this->output .= 'interface ' . $this->name; if (null !== $this->parent) { $this->output .= ' extends ' . $this->parent; } $this->output .= PHP_EOL . '{' . PHP_EOL; $this->output .= $this->formatMethods() . PHP_EOL; $this->output .= '}' . PHP_EOL; if ($ret) { return $this->output; } else { echo $this->output; } }
/** * Render class * * @param boolean $ret * @return mixed */ public function render($ret = false) { $abstract = $this->abstract ? 'abstract ' : null; $this->output = null !== $this->namespace ? $this->namespace->render(true) . PHP_EOL : null; $this->output .= null !== $this->docblock ? $this->docblock->render(true) : null; $this->output .= $abstract . 'class ' . $this->name; if (null !== $this->parent) { $this->output .= ' extends ' . $this->parent; } if (null !== $this->interface) { $this->output .= ' implements ' . $this->interface; } $this->output .= PHP_EOL . '{'; $this->output .= $this->formatProperties() . PHP_EOL; $this->output .= $this->formatMethods() . PHP_EOL; $this->output .= '}' . PHP_EOL; if ($ret) { return $this->output; } else { echo $this->output; } }