public function addParam(
        string $name,
        string $type = null,
        bool $is_def = false,
        $def_value = null,
        string $comment_type = null,
        string $comment = null
    ) : bool {
        $param = array('name' => $name);
        if ($type !== null) {
            $param['type'] = $type;
        }

        if ($is_def) {
            $param['default'] = ($type === 'bool' && $def_value === null ? false : $def_value);
        }

        if ($comment_type !== null) {
            $param['comment_type'] = $comment_type;
        }

        if ($comment !== null) {
            $param['comment'] = $comment;
        }

        $retval = false;

        if (!array_key_exists($name, $this->params)) {
            $this->params[$name] = $param;
            $retval = true;
        }

        return $retval;
    }
public function addParam(
        string $name,
        string $type = null,
        bool $is_def = false,
        $def_value = null,
        string $comment_type = null,
        string $comment = null
    ) : bool {
        $param = array('name' => $name);
        if ($type !== null) {
            $param['type'] = $type;
        }

        if ($is_def) {
            $param['default'] = ($type === 'bool' && $def_value === null ? false : $def_value);
        }

        if ($comment_type !== null) {
            $param['comment_type'] = $comment_type;
        }

        if ($comment !== null) {
            $param['comment'] = $comment;
        }

        $retval = false;

        if (!array_key_exists($name, $this->params)) {
            $this->params[$name] = $param;
            $retval = true;
        }

        return $retval;
    }
public function addParam ( string $ name , string $ type = null , bool $ is_def = false , $ def_value = null , string $ comment_type = null , string $ comment = null ) : bool { $ param = array ( 'name' => $ name ) ; if ( $ type !== null ) { $ param [ 'type' ] = $ type ; } if ( $ is_def ) { $ param [ 'default' ] = ( $ type === 'bool' && $ def_value === null ? false : $ def_value ) ; } if ( $ comment_type !== null ) { $ param [ 'comment_type' ] = $ comment_type ; } if ( $ comment !== null ) { $ param [ 'comment' ] = $ comment ; } $ retval = false ; if ( ! array_key_exists ( $ name , $ this -> params ) ) { $ this -> params [ $ name ] = $ param ; $ retval = true ; } return $ retval ; }
Add a parameter to this function.
@param string $name Name of the parameter.
@param string $type Type of the parameter.
@param bool $is_def If true $def_value is treated as the default value of parameter.
@param mixed $def_value Default value of parameter if $is_def is true. Scalar and string values are interpreted
by type. Objects are unpredictable.
@param string $comment_type Type of the parameter in comment.
@param string $comment Comment of the parameter.
@return bool Returns true if the parameter is added or false if already exists.
Add a parameter to this function .