public static function fromReflection(ReflectionFunction $reflectionFunction)
    {
        $name = self::extractShortNameFromFullyQualifiedName($reflectionFunction->getName());
        $namespace = self::extractNamespaceFromQualifiedName($reflectionFunction->getName());

        $function = new static($name, trim($reflectionFunction->getBody()));
        $function->setNamespace($namespace);
        foreach ($reflectionFunction->getParameters() as $parameter) {
            $function->addParameter(ParameterGenerator::fromReflection($parameter));
        }

        if ($reflectionFunction->getReflectionDocComment()->isEmpty() !== true) {
            $function->setDocumentation(
                DocCommentGenerator::fromReflection($reflectionFunction->getReflectionDocComment())
            );
        }

        return $function;
    }