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;
    }