public function GetProtoHeader(
        \Peg\Lib\Definitions\Element\FunctionElement $function
    )
    {
        $proto = "/* {{{ ";

        foreach($function->overloads as $overload)
        {
            $proto .= "proto ";

            $proto .= $this->symbols->GetPHPStandardType($overload->return_type);

            $proto .= " " . $overload->function->name . "(";

            foreach($overload->parameters as $parameter)
            {
                $proto .= $this->symbols->GetPHPStandardType($parameter);

                if(!$parameter->is_const && ($parameter->is_pointer || $parameter->is_reference))
                {
                    $proto .= " &" . $parameter->name;
                }
                else
                {
                    $proto .= " " . $parameter->name;
                }

                if($parameter->default_value)
                {
                    $proto .= " = " . $parameter->default_value;
                }

                $proto .= ", ";
            }

            $proto = rtrim($proto, ", ");

            $proto .= ")";

            if($overload->description)
                $proto .= "\n       " . $overload->description;

            $proto .= "\n       ";
        }

        $proto = rtrim($proto, " \n");

        $proto .= " */\n";

        return $proto;
    }
public function GetProtoHeader(
        \Peg\Lib\Definitions\Element\FunctionElement $function
    )
    {
        $proto = "/* {{{ ";

        foreach($function->overloads as $overload)
        {
            $proto .= "proto ";

            $proto .= $this->symbols->GetPHPStandardType($overload->return_type);

            $proto .= " " . $overload->function->name . "(";

            foreach($overload->parameters as $parameter)
            {
                $proto .= $this->symbols->GetPHPStandardType($parameter);

                if(!$parameter->is_const && ($parameter->is_pointer || $parameter->is_reference))
                {
                    $proto .= " &" . $parameter->name;
                }
                else
                {
                    $proto .= " " . $parameter->name;
                }

                if($parameter->default_value)
                {
                    $proto .= " = " . $parameter->default_value;
                }

                $proto .= ", ";
            }

            $proto = rtrim($proto, ", ");

            $proto .= ")";

            if($overload->description)
                $proto .= "\n       " . $overload->description;

            $proto .= "\n       ";
        }

        $proto = rtrim($proto, " \n");

        $proto .= " */\n";

        return $proto;
    }
public function GetProtoHeader ( \ Peg \ Lib \ Definitions \ Element \ FunctionElement $ function ) { $ proto = "/* {{{ " ; foreach ( $ function -> overloads as $ overload ) { $ proto .= "proto " ; $ proto .= $ this -> symbols -> GetPHPStandardType ( $ overload -> return_type ) ; $ proto .= " " . $ overload -> function -> name . "(" ; foreach ( $ overload -> parameters as $ parameter ) { $ proto .= $ this -> symbols -> GetPHPStandardType ( $ parameter ) ; if ( ! $ parameter -> is_const && ( $ parameter -> is_pointer || $ parameter -> is_reference ) ) { $ proto .= " &" . $ parameter -> name ; } else { $ proto .= " " . $ parameter -> name ; } if ( $ parameter -> default_value ) { $ proto .= " = " . $ parameter -> default_value ; } $ proto .= ", " ; } $ proto = rtrim ( $ proto , ", " ) ; $ proto .= ")" ; if ( $ overload -> description ) $ proto .= "\n       " . $ overload -> description ; $ proto .= "\n       " ; } $ proto = rtrim ( $ proto , " \n" ) ; $ proto .= " */\n" ; return $ proto ; }
Generates proto doc comments header for a function.
@param \Peg\Lib\Definitions\Element\FunctionElement $function
@return string
Generates proto doc comments header for a function .