Resolves the given FQSEN string into an FQSEN object.

@param string $type
@param Context|null $context

@return Object_
340110
private function resolveTypedObject($type, Context $context = null)
    {
        return new Object_($this->fqsenResolver->resolve($type, $context));
    }
1177027
public static function defaultTypeResolver(
        $value,
        $context,
        ResolveInfo $info,
        AbstractTypeInterface $abstractType
    ) {
        // First, look for `__typename`.
        if (\is_array($value) && isset($value['__typename'])) {
            return $value['__typename'];
        }

        // Otherwise, test each possible type.

        /** @var ObjectType[] $possibleTypes */
        $possibleTypes = $info->getSchema()->getPossibleTypes($abstractType);
        $promises      = [];

        foreach ($possibleTypes as $index => $type) {
            $isTypeOf = $type->isTypeOf($value, $context, $info);

            if ($isTypeOf instanceof PromiseInterface) {
                $promises[$index] = $isTypeOf;
            }

            if (true === $isTypeOf) {
                return $type;
            }
        }

        if (!empty($promises)) {
            return \React\Promise\all($promises)->then(function ($resolvedPromises) use ($possibleTypes) {
                foreach ($resolvedPromises as $index => $result) {
                    if (true === $result) {
                        return $possibleTypes[$index];
                    }
                }

                return null;
            });
        }

        return null;
    }
52795
public function resolve(&$mapping, &$obj, &$context)
    {
        if (empty($mapping)) {
            return $mapping;
        } elseif (is_array($mapping)) {
            $res = [];
            foreach ($mapping as $key => $value) {
                $resolved = $this->resolve($value, $obj, $context);

                if (null !== $resolved) {
                    $res[$key] = $resolved;
                }
            }

            return $res;
        } elseif (is_string($mapping)) {
            $dictionary = array_merge($this->dictionary, ['obj' => $obj, 'context' => $context]);
            $res = null;

            try {
                $res = @$this->evaluator->evaluateWithVars($mapping, $dictionary);
            } catch (\RuntimeException $e) {
                if ($this->debug) {
                    throw $e;
                }
            }

            return $res;
        }

        throw new \RuntimeException('Mapper expected the mapping to be a string or an array');
    }
647768
public function type(string $type): ResolverInterface
    {
        $this->type = DataType::make($type);

        return $this;
    }
866478
public function resolve(
        Parameter $parameter,
        ParameterBag $unresolvedParameters,
        ParameterBag $resolvedParameters,
        ResolvingContext $context = null
    ): ParameterBag {
        $context = ResolvingContext::createFrom($context, $parameter->getKey());

        $self = $this;
        $value = preg_replace_callback(
            self::PATTERN,
            function ($match) use ($self, $context, $unresolvedParameters, &$resolvedParameters, $parameter) {
                $key = $match['parameter'];
                $resolvedParameters = $self->resolveStringKey(
                    $self->resolver,
                    $parameter,
                    $key,
                    $unresolvedParameters,
                    $resolvedParameters,
                    $context
                );

                return $resolvedParameters->get($key);
            },
            $parameter->getValue()
        );

        return $resolvedParameters->with($parameter->withValue($value));
    }
614613
private function resolveTypes($type)
    {
        $batchTypes = [];

        do {
            $batchTypes[] = $batchType = $this->batchRegistry[$type];
        } while (($type = $batchType->getParent()) !== null);

        return $batchTypes;
    }
651830
protected function resolveType($type)
    {
        switch ($type) {
            case IndexMapping::TYPE_BOOLEAN:
                return ["type" => "boolean"];

            case IndexMapping::TYPE_FLOAT:
                return ["type" => "float"];

            case IndexMapping::TYPE_INTEGER:
                return ["type" => "integer"];

            case IndexMapping::TYPE_DATE:
                return ["type" => "date", "format" => "YYYY-MM-dd"];

            case IndexMapping::TYPE_DATETIME:
                return ["type" => "date"];

            case IndexMapping::TYPE_TIME:
                return ["type" => "date", "format" => "HH:mm:ss"];

            default:
            case IndexMapping::TYPE_STRING:
            case IndexMapping::TYPE_BIG_TEXT:
                return ["type" => "string", "analyzer" => "standard"];
        }
    }
565438
private function getStyle(string $type, string $context): string
    {
        if (isset($this->styles[$type][$context])) {
            return $this->styles[$type][$context];
        }

        if (isset($this->styles[$type]['common'])) {
            return $this->styles[$type]['common'];
        }

        if (isset($this->styles[$type]) && is_string($this->styles[$type])) {
            return $this->styles[$type];
        }

        return $this->styles['common'];
    }
126954
public static function get($key = null, $type = 'string', $defaultValue = '')
    {
        if (!$key) {
            return $_GET;
        }
        return self::typeConvert(isset($_GET[$key]) ? $_GET[$key] : $defaultValue, $type);
    }
55391
static function normalize($type, $contextClass=null){
        $resolver = new TypeResolver();
        $context = null;
        if($contextClass){
            //TODO 优化性能
            $contextFactory = new ContextFactory();
            $context = $contextFactory->createFromReflector(new \ReflectionClass($contextClass));
        }
        $type = $resolver->resolve($type, $context);
        $type = ltrim($type, '\\');
        return (string)$type;
    }
1361222
protected function resolveType($object, MappingContext $context): string
    {
        $definition = $context->getDefinition();

        if ($definition->hasType()) {
            return $definition->getType();
        }

        return $this->typeHandler->getType($object, $context);
    }
1038767
public Type resolveType(Type type) {
        if (type instanceof Class) {
            Type resolvedType = types.get(type);
            if (resolvedType != null) {
                return resolvedType;
            }
        }
        return resolver.resolveType(type);
    }
363672
public static function parse(string $type): self
    {
        static $parser = null;
        if (null === $parser) {
            $parser = new Parser();
        }

        return $parser->parse($type);
    }
1370293
public function serializer($type = null)
    {
        $type = $type ?? 'php';

        if (isset($this->serializers[$type])) {
            return $this->serializers[$type];
        }

        return $this->serializers[$type] = $this->resolve($type);
    }
1114366
@Pure
	public static Object getContextResolver() throws AndroidException {
		Object resolver;
		synchronized (Android.class) {
			resolver = (contextResolver == null) ? null : contextResolver.get();
		}
		if (resolver == null) {
			final Object context = getContext();
			try {
				final Class<?> resolverType = getContextResolverClass();
				final Class<?> contextType = context.getClass();
				final Method getContextResolverMethod = contextType.getMethod("getContentResolver"); //$NON-NLS-1$
				resolver = getContextResolverMethod.invoke(context);
				resolver = resolverType.cast(resolver);
				synchronized (Android.class) {
					contextResolver = new WeakReference<>(resolver);
				}
			} catch (AssertionError e) {
				throw e;
			} catch (Throwable e) {
				throw new AndroidException(e);
			}
		}
		return resolver;
	}
1112694
public static function get($type)
    {
        $instance = null;

        switch ($type) {

            case 'IM/Send':
                $instance = new SendService();
                break;

            case 'IM/Status':
                $instance = new StatusService();
                break;

            case 'TFA/Request':
                $instance = new RequestService();
                break;

            case 'TFA/Validate':
                $instance = new ValidateService();
                break;

            default:
                throw new \Exception("Error - Unknow service", 1);

        }
        return $instance;
    }
920720
protected static function reqGetResourceType(ContextInterface $context): ?string
    {
        assert(static::reqHasResourceType($context));

        $value = $context->getRequest()->get(RequestProperties::REQ_RESOURCE_TYPE);

        assert($value === null || is_string($value));

        return $value;
    }