Parse the docblock of the property to get the class of the param annotation.

@param ReflectionParameter $parameter

@throws AnnotationException
@return string|null Type of the property (content of var annotation)
167733
public function getParameterClass(ReflectionParameter $parameter)
    {
        // Use reflection
        $parameterClass = $parameter->getClass();
        if ($parameterClass !== null) {
            return $parameterClass->name;
        }

        $parameterName = $parameter->name;
        // Get the content of the @param annotation
        $method = $parameter->getDeclaringFunction();
        if (preg_match('/@param\s+([^\s]+)\s+\$' . $parameterName . '/', $method->getDocComment(), $matches)) {
            list(, $type) = $matches;
        } else {
            return null;
        }

        // Ignore primitive types
        if (in_array($type, $this->ignoredTypes)) {
            return null;
        }

        // Ignore types containing special characters ([], <> ...)
        if (! preg_match('/^[a-zA-Z0-9\\\\_]+$/', $type)) {
            return null;
        }

        $class = $parameter->getDeclaringClass();

        // If the class name is not fully qualified (i.e. doesn't start with a \)
        if ($type[0] !== '\\') {
            // Try to resolve the FQN using the class context
            $resolvedType = $this->tryResolveFqn($type, $class, $parameter);
         
            if (!$resolvedType && !$this->ignorePhpDocErrors) {
                throw new AnnotationException(sprintf(
                    'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s". '
                        . 'Did you maybe forget to add a "use" statement for this annotation?',
                    $parameterName,
                    $class->name,
                    $method->name,
                    $type
                ));
            }
            
            $type = $resolvedType;
        }

        if (!$this->classExists($type) && !$this->ignorePhpDocErrors) {
            throw new AnnotationException(sprintf(
                'The @param annotation for parameter "%s" of %s::%s contains a non existent class "%s"',
                $parameterName,
                $class->name,
                $method->name,
                $type
            ));
        }

        // Remove the leading \ (FQN shouldn't contain it)
        $type = ltrim($type, '\\');

        return $type;
    }
855068
protected function checkParamType(SmdParameter $parameter, $type)
    {
        switch (true) {
            case $type instanceof Date:
                $parameter->typeFormat = $type->getFormat();
                $parameter->typeAdditional = (string)$type;

                if (empty($parameter->types)) {
                    $parameter->types = ['string'];
                }
                break;

            case $type instanceof Enum:
                if ($type->hasVariants()) {
                    $parameter->typeVariants = $type->getVariants();
                    $parameter->typeAdditional = (string)$type;
                } else {
                    $parameter->typeAdditional = $type->getVariantsType();
                }

                if (empty($parameter->types)) {
                    $parameter->types = [$type->getRealType()];
                }

                break;

            case $type instanceof Object_:
                $parameter->types = ['object'];
                if ($type->getClassName() !== null) {
                    $parameter->typeAdditional = $type->getClassName();
                }
                break;

            case $type instanceof Array_:
                $parameter->array = true;
                $parameter = $this->checkParamType($parameter, $type->getValueType());
                break;

            default:
                $parameter->types = [(string)$type];
        }

        return $parameter;
    }
649456
public String getParameterName(Parameter parameter) {
    Name annotation = parameter.getAnnotation(Name.class);

    if (null == annotation) {
      return parameter.getName();
    }

    return annotation.value();
  }
1002478
public function getMethodAnnotation(ReflectionMethod $method, $annotation = null)
    {
        if ($annotation === null) {
            if ($this->annotation === null) {
                throw new AspectAnnotationException(
                    sprintf('Annotation not provided for aspect: "%s"', get_class($this))
                );
            }

            $annotation = $this->annotation;
        }

        return $this->annotationReader->getMethodAnnotation(
            $method,
            $annotation
        );
    }
596700
public function getAnnotationParam($name, $param, $methodName = NULL, $default = NULL)
	{
		return Annotations::getAnnotationParam($name, $param, $this, $methodName, $default);
	}
270849
public function filterByParameter($parameter)
    {
        $callback = function (BindingInterface $binding, $key) use ($parameter) {
            return $binding->getParameter() == $parameter;
        };

        return $this->filter($callback);
    }
1071614
public function getParameter($parameter, $default = null)
    {
        $value = $this->hasParameter($parameter) ? $this->container->getParameter($parameter) : null;

        return !is_null($value) ? $value : $default;
    }
1191073
private function getType(\ReflectionParameter $parameter, \ReflectionFunctionAbstract $function)
    {
        if (!$type = $parameter->getType()) {
            return;
        }
        $name = $type->getName();
        $lcName = strtolower($name);

        if ('self' !== $lcName && 'parent' !== $lcName) {
            return $name;
        }
        if (!$function instanceof \ReflectionMethod) {
            return;
        }
        if ('self' === $lcName) {
            return $function->getDeclaringClass()->name;
        }
        if ($parent = $function->getDeclaringClass()->getParentClass()) {
            return $parent->name;
        }
    }
474020
public function generateOptionDocParameter($parameter)
    {
        $type = 'mixed';

        if ($parameter->getSchema()) {
            $type = implode('|', $this->convertParameterType($parameter->getSchema()->getType()));
        }

        return sprintf(' *     @var %s $%s %s', $type, $parameter->getName(), $parameter->getDescription() ?: '');
    }
8965
public function handle(\ReflectionParameter $parameter)
    {
        $func = $parameter->getDeclaringFunction();
        $method = new \ReflectionMethod($parameter->getDeclaringClass()->name, $func->name);
        $parameter->getDeclaringFunction()->name;
        $annotations = $this->reader->getMethodAnnotations($method);
        foreach ($annotations as $annotation) {
            if ($annotation instanceof ResourceParam && $annotation->param === $parameter->name) {
                return $this->getResourceParam($annotation->uri);
            }
        }
        (new VoidParamHandler)->handle($parameter);
    }
369826
protected function transformDependency(ReflectionParameter $parameter, $parameters)
    {
        if (is_null($class = $parameter->getClass())) {
            return;
        }

        // The parameter references a class.
        else if (! $class->isSubclassOf(Model::class)) {
            return $this->container->make($class->name);
        }

        $identifier = Arr::first($parameters, function ($parameterKey) use ($parameter)
        {
            return $parameterKey === $parameter->name;
        });

        if (! is_null($identifier)) {
            $instance = $class->newInstance();

            return call_user_func(array($instance, 'find'), $identifier);
        }
    }
52740
public function getValueBy(ParameterInterface $parameter)
    {
        if ($this->isExistBy($parameter) === false) {
            throw new NoBindParameterException('No parameter: ' . (string) $parameter);
        }

        return $this->parameters[$parameter->getHash()];
    }
480677
public function getParameter(\ReflectionParameter $parameter, array $args = [])
    {
        $class = $parameter->getClass();

        if ($class && $this->has($class->name)) {
            return $this->get($class->name);
        }

        if ($class && array_key_exists($class->name, $args)) {
            return $args[$class->name];
        }

        if (array_key_exists($parameter->name, $args)) {
            return $args[$parameter->name];
        }

        throw new NotFoundException("Unresolvable " . ($class ? $class->name : $parameter->name));
    }
1290496
private static function getParameterDefaultValue(\ReflectionParameter $reflectionParameter): string
    {
        $template = '';
        $defaultValue = $reflectionParameter->getDefaultValue();
        if ($reflectionParameter->isDefaultValueConstant()) {
            $defaultConst = $reflectionParameter->getDefaultValueConstantName();
            $template = " = {$defaultConst}";
        } elseif (\is_bool($defaultValue)) {
            $value = $defaultValue ? 'true' : 'false';
            $template = " = {$value}";
        } elseif (\is_string($defaultValue)) {
            $template = " = ''";
        } elseif (\is_int($defaultValue)) {
            $template = ' = 0';
        } elseif (\is_array($defaultValue)) {
            $template = ' = []';
        } elseif (\is_float($defaultValue)) {
            $template = ' = []';
        } elseif (\is_object($defaultValue) || null === $defaultValue) {
            $template = ' = null';
        }

        return $template;
    }
106393
public function get($parameter=null) {

        if ( is_null($parameter) ) return $this->parameters;

        return $this->getFromParts(self::splitParts($parameter));

    }
339304
public function getParameterDescription(ReflectionParameter $param): ?string
    {
        $name = preg_quote($param->getName());

        if (preg_match('~@param\h+\H+\h+\$' . $name . '\h+(.*)~', $this->comment, $m)) {
            return ucfirst(trim($m[1]));
        }

        return null;
    }
1060167
private function extractMessageClass(array $parameters): string
    {
        if (0 === \count($parameters))
        {
            throw InvalidHandlerArguments::emptyArguments();
        }

        /** @var \ReflectionParameter $firstArgument */
        $firstArgument = $parameters[0];

        if (null !== $firstArgument->getType())
        {
            /** @var \ReflectionType $type */
            $type = $firstArgument->getType();

            /** @psalm-var class-string $className */
            $className = $type->getName();

            /** @psalm-suppress RedundantConditionGivenDocblockType */
            if (true === \class_exists($className))
            {
                return $className;
            }
        }

        throw InvalidHandlerArguments::invalidFirstArgument();
    }