protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
    {
        $docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context);

        $returnType = null;
        if ($object->getReturnType() !== null) {
            $typeResolver = new TypeResolver();
            if ($object->getReturnType() instanceof NullableType) {
                $typeString = '?' . $object->getReturnType()->type;
            } else {
                $typeString = (string) $object->getReturnType();
            }

            $returnType = $typeResolver->resolve($typeString, $context);
        }

        $method = new MethodDescriptor(
            $object->fqsen,
            $this->buildVisibility($object),
            $docBlock,
            $object->isAbstract(),
            $object->isStatic(),
            $object->isFinal(),
            new Location($object->getLine()),
            $returnType
        );

        foreach ($object->params as $param) {
            $method->addArgument($this->createMember($param, $strategies, $context));
        }

        return $method;
    }
protected function doCreate($object, StrategyContainer $strategies, ?Context $context = null)
    {
        $docBlock = $this->createDocBlock($strategies, $object->getDocComment(), $context);

        $returnType = null;
        if ($object->getReturnType() !== null) {
            $typeResolver = new TypeResolver();
            if ($object->getReturnType() instanceof NullableType) {
                $typeString = '?' . $object->getReturnType()->type;
            } else {
                $typeString = (string) $object->getReturnType();
            }

            $returnType = $typeResolver->resolve($typeString, $context);
        }

        $method = new MethodDescriptor(
            $object->fqsen,
            $this->buildVisibility($object),
            $docBlock,
            $object->isAbstract(),
            $object->isStatic(),
            $object->isFinal(),
            new Location($object->getLine()),
            $returnType
        );

        foreach ($object->params as $param) {
            $method->addArgument($this->createMember($param, $strategies, $context));
        }

        return $method;
    }
protected function doCreate ( $ object , StrategyContainer $ strategies , ? Context $ context = null ) { $ docBlock = $ this -> createDocBlock ( $ strategies , $ object -> getDocComment ( ) , $ context ) ; $ returnType = null ; if ( $ object -> getReturnType ( ) !== null ) { $ typeResolver = new TypeResolver ( ) ; if ( $ object -> getReturnType ( ) instanceof NullableType ) { $ typeString = '?' . $ object -> getReturnType ( ) -> type ; } else { $ typeString = ( string ) $ object -> getReturnType ( ) ; } $ returnType = $ typeResolver -> resolve ( $ typeString , $ context ) ; } $ method = new MethodDescriptor ( $ object -> fqsen , $ this -> buildVisibility ( $ object ) , $ docBlock , $ object -> isAbstract ( ) , $ object -> isStatic ( ) , $ object -> isFinal ( ) , new Location ( $ object -> getLine ( ) ) , $ returnType ) ; foreach ( $ object -> params as $ param ) { $ method -> addArgument ( $ this -> createMember ( $ param , $ strategies , $ context ) ) ; } return $ method ; }
Creates an MethodDescriptor out of the given object including its child elements.

@param ClassMethod $object object to convert to an MethodDescriptor
@param StrategyContainer $strategies used to convert nested objects.
@param Context $context of the created object
@return MethodDescriptor
Creates an MethodDescriptor out of the given object including its child elements .