public static function getParameters($statement)
    {
        $retval = [
            'num' => 0,
            'dir' => [],
            'name' => [],
            'type' => [],
            'length' => [],
            'length_arr' => [],
            'opts' => [],
        ];

        if (! empty($statement->parameters)) {
            $idx = 0;
            foreach ($statement->parameters as $param) {
                $retval['dir'][$idx] = $param->inOut;
                $retval['name'][$idx] = $param->name;
                $retval['type'][$idx] = $param->type->name;
                $retval['length'][$idx] = implode(',', $param->type->parameters);
                $retval['length_arr'][$idx] = $param->type->parameters;
                $retval['opts'][$idx] = [];
                foreach ($param->type->options->options as $opt) {
                    $retval['opts'][$idx][] = is_string($opt) ?
                        $opt : $opt['value'];
                }
                $retval['opts'][$idx] = implode(' ', $retval['opts'][$idx]);
                ++$idx;
            }

            $retval['num'] = $idx;
        }

        return $retval;
    }
public static function getParameters($statement)
    {
        $retval = [
            'num' => 0,
            'dir' => [],
            'name' => [],
            'type' => [],
            'length' => [],
            'length_arr' => [],
            'opts' => [],
        ];

        if (! empty($statement->parameters)) {
            $idx = 0;
            foreach ($statement->parameters as $param) {
                $retval['dir'][$idx] = $param->inOut;
                $retval['name'][$idx] = $param->name;
                $retval['type'][$idx] = $param->type->name;
                $retval['length'][$idx] = implode(',', $param->type->parameters);
                $retval['length_arr'][$idx] = $param->type->parameters;
                $retval['opts'][$idx] = [];
                foreach ($param->type->options->options as $opt) {
                    $retval['opts'][$idx][] = is_string($opt) ?
                        $opt : $opt['value'];
                }
                $retval['opts'][$idx] = implode(' ', $retval['opts'][$idx]);
                ++$idx;
            }

            $retval['num'] = $idx;
        }

        return $retval;
    }
public static function getParameters ( $ statement ) { $ retval = [ 'num' => 0 , 'dir' => [ ] , 'name' => [ ] , 'type' => [ ] , 'length' => [ ] , 'length_arr' => [ ] , 'opts' => [ ] , ] ; if ( ! empty ( $ statement -> parameters ) ) { $ idx = 0 ; foreach ( $ statement -> parameters as $ param ) { $ retval [ 'dir' ] [ $ idx ] = $ param -> inOut ; $ retval [ 'name' ] [ $ idx ] = $ param -> name ; $ retval [ 'type' ] [ $ idx ] = $ param -> type -> name ; $ retval [ 'length' ] [ $ idx ] = implode ( ',' , $ param -> type -> parameters ) ; $ retval [ 'length_arr' ] [ $ idx ] = $ param -> type -> parameters ; $ retval [ 'opts' ] [ $ idx ] = [ ] ; foreach ( $ param -> type -> options -> options as $ opt ) { $ retval [ 'opts' ] [ $ idx ] [ ] = is_string ( $ opt ) ? $ opt : $ opt [ 'value' ] ; } $ retval [ 'opts' ] [ $ idx ] = implode ( ' ' , $ retval [ 'opts' ] [ $ idx ] ) ; ++ $ idx ; } $ retval [ 'num' ] = $ idx ; } return $ retval ; }
Gets the parameters of a routine from the parse tree.

@param CreateStatement $statement the statement to be processed

@return array
Gets the parameters of a routine from the parse tree .