Client.php
protected function getMethodArguments($methodName)
    {
        if (!empty($this->_magicMethodArgumentNames)) {
            return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
        }
        try {
            $reflectionClass = new \ReflectionClass($this);
            $comment = $reflectionClass->getDocComment();
            $lines = preg_split('/[\r\n]/', $comment);
            $regexp = '#\s*\*\s*@method ((?:.*) )?([a-zA-Z_]+)\(((?:[\\a-zA-Z]+\s+)?\$(?:[a-zA-Z_]+),?\s*)*\)#';

            foreach ($lines as $line) {
                $matches = [];
                if (preg_match($regexp, $line, $matches)) {
                    @list($null, $returnType, $method, $argumentString) = $matches;
                    if (is_null($argumentString)) {
                        $arguments = [];
                    } else {
                        $arguments = array_map('trim', explode(',', $argumentString));

                        foreach ($arguments as $k => $argument) {
                            if (empty($argument)) {
                                continue;
                            }
                            if (strpos($argument, ' ') !== false) {
                                $tmp = explode(' ', $argument);
                                $arguments[$k] = ['name' => ltrim($tmp[1], '$'), 'type' => $tmp[0]];
                            } else {
                                $arguments[$k] = ['name' => ltrim($argument, '$'), 'type' => 'mixed'];
                            }
                        }
                    }

                    $this->_magicMethodArgumentNames[$method] = $arguments;
                }
            }
        } catch (\ReflectionException $e) {

        }

        return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
    }
protected function getMethodArguments($methodName)
    {
        if (!empty($this->_magicMethodArgumentNames)) {
            return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
        }
        try {
            $reflectionClass = new \ReflectionClass($this);
            $comment = $reflectionClass->getDocComment();
            $lines = preg_split('/[\r\n]/', $comment);
            $regexp = '#\s*\*\s*@method ((?:.*) )?([a-zA-Z_]+)\(((?:[\\a-zA-Z]+\s+)?\$(?:[a-zA-Z_]+),?\s*)*\)#';

            foreach ($lines as $line) {
                $matches = [];
                if (preg_match($regexp, $line, $matches)) {
                    @list($null, $returnType, $method, $argumentString) = $matches;
                    if (is_null($argumentString)) {
                        $arguments = [];
                    } else {
                        $arguments = array_map('trim', explode(',', $argumentString));

                        foreach ($arguments as $k => $argument) {
                            if (empty($argument)) {
                                continue;
                            }
                            if (strpos($argument, ' ') !== false) {
                                $tmp = explode(' ', $argument);
                                $arguments[$k] = ['name' => ltrim($tmp[1], '$'), 'type' => $tmp[0]];
                            } else {
                                $arguments[$k] = ['name' => ltrim($argument, '$'), 'type' => 'mixed'];
                            }
                        }
                    }

                    $this->_magicMethodArgumentNames[$method] = $arguments;
                }
            }
        } catch (\ReflectionException $e) {

        }

        return ArrayHelper::getValue($this->_magicMethodArgumentNames, $methodName, []);
    }
protected function getMethodArguments ( $ methodName ) { if ( ! empty ( $ this -> _magicMethodArgumentNames ) ) { return ArrayHelper :: getValue ( $ this -> _magicMethodArgumentNames , $ methodName , [ ] ) ; } try { $ reflectionClass = new \ ReflectionClass ( $ this ) ; $ comment = $ reflectionClass -> getDocComment ( ) ; $ lines = preg_split ( '/[\r\n]/' , $ comment ) ; $ regexp = '#\s*\*\s*@method ((?:.*) )?([a-zA-Z_]+)\(((?:[\\a-zA-Z]+\s+)?\$(?:[a-zA-Z_]+),?\s*)*\)#' ; foreach ( $ lines as $ line ) { $ matches = [ ] ; if ( preg_match ( $ regexp , $ line , $ matches ) ) { @ list ( $ null , $ returnType , $ method , $ argumentString ) = $ matches ; if ( is_null ( $ argumentString ) ) { $ arguments = [ ] ; } else { $ arguments = array_map ( 'trim' , explode ( ',' , $ argumentString ) ) ; foreach ( $ arguments as $ k => $ argument ) { if ( empty ( $ argument ) ) { continue ; } if ( strpos ( $ argument , ' ' ) !== false ) { $ tmp = explode ( ' ' , $ argument ) ; $ arguments [ $ k ] = [ 'name' => ltrim ( $ tmp [ 1 ] , '$' ) , 'type' => $ tmp [ 0 ] ] ; } else { $ arguments [ $ k ] = [ 'name' => ltrim ( $ argument , '$' ) , 'type' => 'mixed' ] ; } } } $ this -> _magicMethodArgumentNames [ $ method ] = $ arguments ; } } } catch ( \ ReflectionException $ e ) { } return ArrayHelper :: getValue ( $ this -> _magicMethodArgumentNames , $ methodName , [ ] ) ; }
Get argument names and positions and data types from phpdoc class comment

@param string $methodName method to get arguments from
@return mixed
Get argument names and positions and data types from phpdoc class comment