Render method parameter's type hint.

@param \ReflectionParameter $parameter

@return string
963281
protected function renderParameterTypeHint($parameter)
    {
        $typeHint = $parameter->hasType() ? (string) $parameter->getType() : '';

        $typeHint = trim($typeHint);

        if ($typeHint) {
            // If the type is not a built in types, we should add a leading slash
            // in the type hint be make the class name not confusing.
            if (
                ! in_array($typeHint, [
                    'self', 'array', 'callable', 'bool', 'float', 'int', 'string',
                    'object', 'iterable', 'void'
                ])
            ) {
                $typeHint = '\\'.$typeHint;
            }

            if ($parameter->allowsNull()) {
                $typeHint = '?'.$typeHint;
            }

            $typeHint .= ' ';
        }

        return $typeHint;
    }
583892
public static function typehint($parameter)
    {
        $typehint = '';
        if ($parameter->getClass()) {
            $typehint = '\\' . $parameter->getClass()->getName();
        } elseif (preg_match('/.*?\[ \<[^\>]+\> (?:HH\\\)?(\w+)(.*?)\$/', (string) $parameter, $match)) {
            $typehint = $match[1];
            if ($typehint === 'integer') {
                $typehint = 'int';
            } elseif ($typehint === 'boolean') {
                $typehint = 'bool';
            } elseif ($typehint === 'mixed') {
                $typehint = '';
            }
        }
        return $typehint;
    }
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;
    }
1105260
protected function getDeclaringFunction(ReflectionParameter $parameter): string
	{
		$declaringFunction = $parameter->getDeclaringFunction();

		if($declaringFunction->isClosure())
		{
			return 'Closure';
		}

		if(($class = $parameter->getDeclaringClass()) === null)
		{
			return $declaringFunction->getName();
		}

		return $class->getName() . '::' . $declaringFunction->getName();
	}
424195
public function getParameter($parameter)
    {
        $param_array = $this->getParameters();

        if (!empty($param_array) && array_key_exists($parameter, $param_array)) {
            return $param_array[$parameter];
        } else {
            throw new \Exception('UNKNOWN_PARAMETER');
        }
    }
866599
private function determineParamValue(\ReflectionParameter $parameter)
    {
        $class = $parameter->getClass();

        if (!empty($class)) {
            // If this is a object we may be able to map it to something in our context
            $className = $class->getName();

            // Determine strong type-based link
            if (isset($this->instances[$className])) {
                return $this->instances[$className];
            }

            // Determine weak type-based link
            if (isset($this->weakLinks[$className])) {
                $lowerClassName = $this->weakLinks[$className];
                return $this->instances[$lowerClassName];
            }
        } else {
            // If this is a primitive type, attempt to determine it by its name
            $varName = $parameter->getName();

            if (isset($this->variablesByName[$varName])) {
                return $this->variablesByName[$varName];
            }
        }

        // We were unable to determine a suitable value based on this context. Pass back its default value if possible.
        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }

        // As a final fallback we will primitive pass NULL and let the function deal with it.
        return null;
    }
1280448
private function getArgumentByName(\ReflectionParameter $parameter, $parameters)
    {
        foreach ($parameters as $name => $item) {
            $paramName = $parameter->getName();
            if ($name === $paramName) {
                return $item;
            }
        }

        return null;
    }
1149999
private function validateParameter(\ReflectionParameter $parameter)
    {
        $catcher = function ($className) {
            $generator = $this->generator($className);
            if ($generator) {
                include $generator->generate();
            }
        };
        
        if (($reflectionClass = $parameter->getDeclaringClass())
            && ($reflectionMethod = $parameter->getDeclaringFunction())) {
            $type = $this->typeHintIndex->lookup(
                $reflectionClass->getName(),
                $reflectionMethod->getName(),
                '$' . $parameter->getName()
            );

            if ($type && !class_exists($type) && !interface_exists($type)) {
                $catcher($type);
                return $this;
            }
        }

        spl_autoload_register($catcher);
        try {
            $parameter->getClass();
        } catch (\ReflectionException $e) {
            // Ignore reflection exception, as it is an intended behaviour for our catcher
        }
        spl_autoload_unregister($catcher);
        return $this;
    }
423664
private static function getParameterName(\ReflectionParameter $parameter) : string
    {
        $parameterType = '';

        if (null !== $type = $parameter->getType()) {
            $parameterType = (string) $type . ' ';
        }

        return $parameterType . '$' . $parameter->getName();
    }
766009
private static function formatFunctionParams(\ReflectionFunctionAbstract $reflector)
    {
        $params = [];
        foreach ($reflector->getParameters() as $param) {
            $hint = '';
            try {
                if ($param->isArray()) {
                    $hint = '<keyword>array</keyword> ';
                } elseif ($class = $param->getClass()) {
                    $hint = \sprintf('<class>%s</class> ', $class->getName());
                }
            } catch (\Exception $e) {
                // sometimes we just don't know...
                // bad class names, or autoloaded classes that haven't been loaded yet, or whathaveyou.
                // come to think of it, the only time I've seen this is with the intl extension.

                // Hax: we'll try to extract it :P

                // @codeCoverageIgnoreStart
                $chunks = \explode('$' . $param->getName(), (string) $param);
                $chunks = \explode(' ', \trim($chunks[0]));
                $guess  = \end($chunks);

                $hint = \sprintf('<urgent>%s</urgent> ', $guess);
                // @codeCoverageIgnoreEnd
            }

            if ($param->isOptional()) {
                if (!$param->isDefaultValueAvailable()) {
                    $value     = 'unknown';
                    $typeStyle = 'urgent';
                } else {
                    $value     = $param->getDefaultValue();
                    $typeStyle = self::getTypeStyle($value);
                    $value     = \is_array($value) ? 'array()' : \is_null($value) ? 'null' : \var_export($value, true);
                }
                $default = \sprintf(' = <%s>%s</%s>', $typeStyle, OutputFormatter::escape($value), $typeStyle);
            } else {
                $default = '';
            }

            $params[] = \sprintf(
                '%s%s<strong>$%s</strong>%s',
                $param->isPassedByReference() ? '&' : '',
                $hint,
                $param->getName(),
                $default
            );
        }

        return $params;
    }
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;
    }
75957
public function getParameterType(
        ReflectionMethod $method,
        string $parameterName,
        ? string $default = null
    ) : ? string {
        $parameters = $method->getParameters();

        foreach ($parameters as $parameter) {
            if ($parameter->getName() === $parameterName) {
                $class = $parameter->getClass();

                return $class
                    ? $class->getName()
                    : $default;
            }
        }

        return $default;
    }
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);
        }
    }
1028186
public function render(array $parameters = []): string
    {
        $urls = $this->replaceUrlPlaceholders();

        return $this->twig->render(
            $this->template,
            $parameters + ['urls' => $urls, 'ez' => $this->ezSystemInfo] + $this->parameters
        );
    }
171842
protected function resolveNonClass(ReflectionParameter $parameter)
    {
        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }
        $message = "Unresolvable dependency resolving [$parameter] in class {$parameter->getDeclaringClass()->getName()}";
        throw new \Exception($message);
    }
202242
public static function getParameterType(\ReflectionParameter $param): ?string
    {
        if (!$param->hasType()) {
            return null;
        }

        $type = $param->getType();

        if ($type === null || $type->isBuiltin()) {
            return null;
        }

        $type = $type->getName();
        $lower = \strtolower($type);

        if ($lower === 'self') {
            return $param->getDeclaringClass()->getName();
        }

        if ($lower === 'parent' && ($parent = $param->getDeclaringClass()->getParentClass())) {
            return $parent->getName();
        }

        return $type;
    }
1039990
private function createParamString(\ReflectionParameter $parameter, string $type): string
    {
        $message = '';
        if (!in_array($type, [PropertyBinding::TYPE, ConstantBinding::TYPE, ListBinding::TYPE, MapBinding::TYPE])) {
            $message .= $type . ' ';
        } elseif ($parameter->isArray()) {
            $message .= 'array ';
        }

        return $message . '$' . $parameter->getName();
    }