public function getFunctionParameterTypes(\ReflectionFunctionAbstract $function) : array
    {
        return $this->cache(__FUNCTION__, $function, static function() use ($function) {
            $docComment = $function->getDocComment();

            if ($docComment === false) {
                return [];
            }

            preg_match_all('/@param\s+(\S+)\s+\$(\S+)/', $docComment, $matches, PREG_SET_ORDER);

            $types = [];
            foreach ($matches as $match) {
                $types[$match[2]] = explode('|', $match[1]);
            }

            return $types;
        });
    }
public function getFunctionParameterTypes(\ReflectionFunctionAbstract $function) : array
    {
        return $this->cache(__FUNCTION__, $function, static function() use ($function) {
            $docComment = $function->getDocComment();

            if ($docComment === false) {
                return [];
            }

            preg_match_all('/@param\s+(\S+)\s+\$(\S+)/', $docComment, $matches, PREG_SET_ORDER);

            $types = [];
            foreach ($matches as $match) {
                $types[$match[2]] = explode('|', $match[1]);
            }

            return $types;
        });
    }
public function getFunctionParameterTypes ( \ ReflectionFunctionAbstract $ function ) : array { return $ this -> cache ( __FUNCTION__ , $ function , static function ( ) use ( $ function ) { $ docComment = $ function -> getDocComment ( ) ; if ( $ docComment === false ) { return [ ] ; } preg_match_all ( '/@param\s+(\S+)\s+\$(\S+)/' , $ docComment , $ matches , PREG_SET_ORDER ) ; $ types = [ ] ; foreach ( $ matches as $ match ) { $ types [ $ match [ 2 ] ] = explode ( '|' , $ match [ 1 ] ) ; } return $ types ; } ) ; }
Returns an associative array of the types documented on a function.

The keys are the parameter names, and values the documented types as an array.
This method does not check that parameter names actually exist,
so documented types might not match the function parameter names.

@param \ReflectionFunctionAbstract $function

@return array
Returns an associative array of the types documented on a function .