Find the resolve target of class.

@param ContainerBuilder $container The container
@param string           $class     The class name

@return string
770024
private function findResolveTarget(ContainerBuilder $container, $class)
    {
        $resolveTargets = $this->getResolveTargets($container);

        if (isset($resolveTargets[$class])) {
            $class = $resolveTargets[$class];
        }

        return $class;
    }
130361
public function resolveClass( $class )
	{
		if ( !is_string( $class ) )
			throw new ResolverException( "Class must be a string" );

		// Check if a class has been mapped to a key
		if ( array_key_exists( $class, $this->classAlias ) )
			try
			{
				return $this->resolve( null, $this->classAlias[$class] );
			}
			catch ( ResolverException $e )
			{
				// Ignore
			}

		// Check if the class has been initialized
		foreach ( $this->instances as $instance )
			if ( get_class( $instance ) == $class )
				return $instance;

		// TODO Other methods to check?

		return false;
	}
771039
private function validateContainer($container)
    {
        if ($container === false)
            return $container;
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'panel' => false,
            'class' => false,
            'rows' => false,
            'headerRow' => false,
            'collection' => false,
        ]);
        $resolver->setAllowedTypes('class', ['string', 'boolean']);
        $resolver->setAllowedTypes('panel', ['array', 'boolean']);
        $resolver->setAllowedTypes('rows', ['array', 'boolean']);
        $resolver->setAllowedTypes('headerRow', ['array', 'boolean']);
        $resolver->setAllowedTypes('collection', ['array', 'boolean']);
        $container = $resolver->resolve($container);

        $container['panel'] = $this->validatePanel($container['panel']);

        if (($container['panel'] !== false && $container['class'] !== false) || ( $container['panel'] === false && $container['class'] === false))
            trigger_error(sprintf('Containers must specify one of a panel (%s) or a class (%s), but not both.', $container['panel']['colour'], $container['class']), E_USER_ERROR);

        $container['collection'] = $this->validateCollection($container['collection']);

        $container['headerRow'] = $this->validateRow($container['headerRow']);
        $container['rows'] = $this->validateRows($container['rows']);

        return $container;
    }
283090
public function process(ContainerBuilder $container): void
    {
        if ($container->has('ezpublish.image_alias.imagine.cache_resolver')) {
            $container
                ->findDefinition('ezpublish.image_alias.imagine.cache_resolver')
                ->setClass(IORepositoryResolver::class);
        }
    }
575917
private function processClassResolvers(ContainerBuilder $container)
    {
        $references = $this->processor->findAndSortTaggedServices($container, self::CLASS_RESOLVER_TAG);
        $definition = $container->getDefinition(self::getEnvironmentHandlerId());

        foreach ($references as $reference) {
            $definition->addMethodCall('registerClassResolver', array($reference));
        }
    }
365702
private function resolveParameterName(
        ContainerBuilder $container,
        $parameterName
    ) {
        if (!is_string($parameterName)) {
            return $parameterName;
        }

        return $container->hasParameter($parameterName)
            ? $container->getParameter($parameterName)
            : $parameterName;
    }
513912
private function processClassGenerators(ContainerBuilder $container)
    {
        $references = $this->processor->findAndSortTaggedServices($container, self::CLASS_GENERATOR_TAG);
        $definition = $container->getDefinition(self::getSuiteSetupId());

        foreach ($references as $reference) {
            $definition->addMethodCall('registerClassGenerator', array($reference));
        }
    }
117982
private function doResolveClass($class)
    {
        foreach ($this->map as $mapClass => $value) {
            if (!$value) {
                continue;
            }

            if ($class === $mapClass || is_subclass_of($class, $mapClass)) {
                return $value;
            }
        }

        return false;
    }
232841
public function resolve(Container $container, array $args = [])
    {
        if ($this->resolvedDefinition && $this->shared === true) {
            return $this->resolvedDefinition;
        }

        $definitionResolver = new DefinitionResolver($container);
        $this->resolvedDefinition = $definitionResolver->resolver($this->definition, $args);
        $this->resolved = true;

        return $this->resolvedDefinition;
    }
240347
public function locate($class)
    {
        $path = false;

        if(self::$__loader) {
            $path = self::$__loader->findFile($class);
        }

        return $path;
    }
1271447
public function container(string $containerClass = Container::class): ContainerInterface
    {
        if (($source = $this->getDefinitionSource()) instanceof MutableDefinitionSource) {
            return new $containerClass($source, $this->getProxyFactory(), $this->getWrapperContainer());
        }
        return $source;
    }
36565
protected function resolveClass(string $class, array $primitives = [])
    {
        try {
            if (isset($this->constructorReflectionCache[$class])) {
                list($constructor, $parameters) = $this->constructorReflectionCache[$class];
            } else {
                $reflectionClass = new ReflectionClass($class);
                if (!$reflectionClass->isInstantiable()) {
                    throw new IocException(
                        sprintf(
                            '%s is not instantiable%s',
                            $class,
                            $this->currentTarget === null ? '' : " (dependency of {$this->currentTarget})"
                        )
                    );
                }

                $constructor = $reflectionClass->getConstructor();
                $parameters = $constructor !== null ? $constructor->getParameters() : null;
                $this->constructorReflectionCache[$class] = [$constructor, $parameters];
            }

            if ($constructor === null) {
                // No constructor, so instantiating is easy
                return new $class;
            }

            $constructorParameters = $this->resolveParameters($class, $parameters, $primitives);

            return new $class(...$constructorParameters);
        } catch (ReflectionException $ex) {
            throw new IocException("Failed to resolve class $class", 0, $ex);
        }
    }
822924
protected function resolve( $class )
	{
		$instance = UniversalBuilder::resolveClass( $class );

		if ( isset( $this->command ) )
			$instance->setCommand( $this->command );

		return $instance;
	}
530581
public function process(ContainerBuilder $container)
    {
        if (! $container->hasDefinition('alchemy_worker.type_based_worker_resolver')) {
            return;
        }

        $resolverDefinition = $container->getDefinition('alchemy_worker.type_based_worker_resolver');
        $factoryServices = $container->findTaggedServiceIds('alchemy_worker.worker_factory');

        foreach ($factoryServices as $id => $tags) {
            foreach ($tags as $tag) {
                $resolverDefinition->addMethodCall('setFactory', [ $tag['message_type'], new Reference($id) ]);
            }
        }
    }
1136405
public function resolveAndCreate($namespace, ContainerInterface $container)
    {
        $class = new \ReflectionClass($namespace);
        $arguments = $this->resolveReflectionArguments($class, $container);

        return $class->newInstanceArgs($arguments);
    }
1245707
protected function resolve($className, $contextClass)
    {
        $moduleOptionsPluginManager = $this->getModuleOptionsPluginManager();
        if (!$moduleOptionsPluginManager->hasModuleNameByClassName($className)) {
            return null;
        }
        $classModuleName = $moduleOptionsPluginManager->getModuleNameByClassName($className);

        $shortClassName = substr($className, strlen($classModuleName));

        if (!$moduleOptionsPluginManager->hasModuleNameByClassName($contextClass)) {
            return null;
        }
        $contextModuleName = $moduleOptionsPluginManager->getModuleNameByClassName($contextClass);

        $resolvedClassName = $contextModuleName . $shortClassName;

        if (!class_exists($resolvedClassName)) {
            return null;
        }

        return $resolvedClassName;
    }
139515
protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceId)
    {
        if ($builder->hasDefinition($serviceId)) {
            return $builder->getDefinition($serviceId);
        }

        // Some service IDs don't have a Definition, they're aliases
        if ($builder->hasAlias($serviceId)) {
            return $builder->getAlias($serviceId);
        }

        if ('service_container' === $serviceId) {
            return (new Definition(ContainerInterface::class))->setPublic(true)->setSynthetic(true);
        }

        // the service has been injected in some special way, just return the service
        return $builder->get($serviceId);
    }