/** * Renders a method code. * * @return string */ public function render() { if ($docComment = $this->getDocComment()) { $docComment .= "\n"; } $code = sprintf($this->_getMethodFormat(), $docComment, $this->getVisibility(), $this->isStatic() ? ' static' : null, $this->isReference() ? '&' : null, $this->getName(), $this->_formatArguments($this->getArguments()), Stagehand_PHP_Class_CodeGenerator::indent($this->getCode())); if ($this->isFinal()) { $code = 'final ' . $code; } return $code; }
/** * Gets all constant's code. * * @return string */ protected function _getAllConstantsCode() { $constants = $this->_class->getConstants(); if (!count($constants)) { return; } $allConstantCodes = array(); foreach ($constants as $constant) { if ($code = $this->_createConstantCode($constant)) { array_push($allConstantCodes, $code); } } return Stagehand_PHP_Class_CodeGenerator::indent(implode("\n", $allConstantCodes)) . "\n"; }