protected function addVariadicArgument(Method $data, MethodDescriptor $methodDescriptor): void
    {
        if (!$data->getDocBlock()) {
            return;
        }

        $paramTags = $data->getDocBlock()->getTagsByName('param');

        /** @var Param $lastParamTag */
        $lastParamTag = end($paramTags);
        if (!$lastParamTag) {
            return;
        }

        if ($lastParamTag->isVariadic()
            && array_key_exists($lastParamTag->getVariableName(), $methodDescriptor->getArguments()->getAll())
        ) {
            $types = $lastParamTag->getType();

            $argument = new ArgumentDescriptor();
            $argument->setName($lastParamTag->getVariableName());
            $argument->setType($types);
            $argument->setDescription($lastParamTag->getDescription());
            $argument->setLine($methodDescriptor->getLine());
            $argument->setVariadic(true);

            $methodDescriptor->getArguments()->set($argument->getName(), $argument);
        }
    }
protected function addVariadicArgument(Method $data, MethodDescriptor $methodDescriptor): void
    {
        if (!$data->getDocBlock()) {
            return;
        }

        $paramTags = $data->getDocBlock()->getTagsByName('param');

        /** @var Param $lastParamTag */
        $lastParamTag = end($paramTags);
        if (!$lastParamTag) {
            return;
        }

        if ($lastParamTag->isVariadic()
            && array_key_exists($lastParamTag->getVariableName(), $methodDescriptor->getArguments()->getAll())
        ) {
            $types = $lastParamTag->getType();

            $argument = new ArgumentDescriptor();
            $argument->setName($lastParamTag->getVariableName());
            $argument->setType($types);
            $argument->setDescription($lastParamTag->getDescription());
            $argument->setLine($methodDescriptor->getLine());
            $argument->setVariadic(true);

            $methodDescriptor->getArguments()->set($argument->getName(), $argument);
        }
    }
protected function addVariadicArgument ( Method $ data , MethodDescriptor $ methodDescriptor ) : void { if ( ! $ data -> getDocBlock ( ) ) { return ; } $ paramTags = $ data -> getDocBlock ( ) -> getTagsByName ( 'param' ) ; /** @var Param $lastParamTag */ $ lastParamTag = end ( $ paramTags ) ; if ( ! $ lastParamTag ) { return ; } if ( $ lastParamTag -> isVariadic ( ) && array_key_exists ( $ lastParamTag -> getVariableName ( ) , $ methodDescriptor -> getArguments ( ) -> getAll ( ) ) ) { $ types = $ lastParamTag -> getType ( ) ; $ argument = new ArgumentDescriptor ( ) ; $ argument -> setName ( $ lastParamTag -> getVariableName ( ) ) ; $ argument -> setType ( $ types ) ; $ argument -> setDescription ( $ lastParamTag -> getDescription ( ) ) ; $ argument -> setLine ( $ methodDescriptor -> getLine ( ) ) ; $ argument -> setVariadic ( true ) ; $ methodDescriptor -> getArguments ( ) -> set ( $ argument -> getName ( ) , $ argument ) ; } }
Checks if there is a variadic argument in the `@param` tags and adds it to the list of Arguments in
the Descriptor unless there is already one present.
Checks if there is a variadic argument in the