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;
        });
    }