public function buildCode()
    {
        $code = '';

        if ($this->documentation) {
            $code .= '    /**'."\n";
            $code .= '     * '.str_replace("\n", "\n     * ", wordwrap($this->documentation, 73))."\n";
            $code .= '     */'."\n";
        }

        $code .= '    public function '.$this->name.'('.implode(', ', $this->parameters).')'."\n";
        $code .= '    {'."\n";
        $code .= '        '.str_replace("\n", "\n        ", $this->body)."\n";
        $code .= '    }';

        // Trim trailing whitespaces
        $code = preg_replace('/[ ]+$/m', '', $code);

        return $code;
    }
public function buildCode()
    {
        $code = '';

        if ($this->documentation) {
            $code .= '    /**'."\n";
            $code .= '     * '.str_replace("\n", "\n     * ", wordwrap($this->documentation, 73))."\n";
            $code .= '     */'."\n";
        }

        $code .= '    public function '.$this->name.'('.implode(', ', $this->parameters).')'."\n";
        $code .= '    {'."\n";
        $code .= '        '.str_replace("\n", "\n        ", $this->body)."\n";
        $code .= '    }';

        // Trim trailing whitespaces
        $code = preg_replace('/[ ]+$/m', '', $code);

        return $code;
    }
public function buildCode ( ) { $ code = '' ; if ( $ this -> documentation ) { $ code .= '    /**' . "\n" ; $ code .= '     * ' . str_replace ( "\n" , "\n     * " , wordwrap ( $ this -> documentation , 73 ) ) . "\n" ; $ code .= '     */' . "\n" ; } $ code .= '    public function ' . $ this -> name . '(' . implode ( ', ' , $ this -> parameters ) . ')' . "\n" ; $ code .= '    {' . "\n" ; $ code .= '        ' . str_replace ( "\n" , "\n        " , $ this -> body ) . "\n" ; $ code .= '    }' ; // Trim trailing whitespaces $ code = preg_replace ( '/[ ]+$/m' , '' , $ code ) ; return $ code ; }
Builds the PHP code for the method.

@return string The method code
Builds the PHP code for the method .