If the service has not been defined within the container, attempt to instantiate the class directly

@param string $fqClassName Fully qualified class name
@param array  $parameters Parameters object may require for constructor
@return object
499338
private function getUndefined($fqClassName, array $parameters)
    {
        // Only use ReflectionClass if parameters are needed in constructor
        if (!empty($parameters)) {
            $reflectionClass = new ReflectionClass($fqClassName);
            return $reflectionClass->newInstanceArgs($parameters);
        }

        return new $fqClassName;
    }
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));
    }
1033986
protected function buildProxy(string $fqcn): ProxyInterface
    {
        return ProxyGeneratorFactory::get($this->mockingStrategy)->get($fqcn);
    }
365294
public function makeGetProfileRequest($parameters)
    {
        $obj = new CIMGetProfileRequest($this->httpClient, $this->httpRequest);
        $obj->initialize(array_replace($this->getParameters(), $parameters));
        return $obj->send();
    }
829146
public function initiateObject($className, $additionalParameters = array(), $shared = false)
    {
        if (isset($this->sharedInstances[$className])) {
            return $this->sharedInstances[$className];
        }
        
        $reflection = new ReflectionClass($className);
        
        if ($reflection->hasMethod('__construct')) {
            $constructor = $reflection->getConstructor();
            $parameters = $this->prepareParameters($constructor, $additionalParameters);
            
            $instance = $reflection->newInstanceArgs($parameters);
        } else {
            $instance = new $className();
        }
        
        if ($shared) {
            $this->sharedInstances[$className] = $instance;
        }
        
        return $instance;
    }
71437
public function load($pluginFqcn, $pluginPath = null)
    {
        if (!$pluginPath) {
            $rPlugin = new \ReflectionClass($pluginFqcn);
            $pluginPath = $rPlugin->getFileName();
        }

        if (!file_exists($pluginPath)) {
            throw new RuntimeException(
                "No bundle class file matches the FQCN '{$pluginFqcn}' "
                .'(expected path was : '.$pluginPath.')',
                self::NO_PLUGIN_FOUND
            );
        }

        return $this->getPluginInstance($pluginPath, $pluginFqcn);
    }
979744
public function withParameters(array $parameters): self
    {
        $query = $this;

        foreach ($parameters as $key => $parameter) {
            $query = $query->withParameter($key, $parameter);
        }

        return $query;
    }
328844
public function make($abstract, $parameters = array())
    {
        $abstract = $this->getAlias($abstract);

        if (isset($this->deferredServices[$abstract])) {
            $this->loadDeferredProvider($abstract);
        }

        return parent::make($abstract, $parameters);
    }
1343788
private function createInstance(string $class, array $parameters, string $context = null)
    {
        $reflection = new \ReflectionClass($class);

        //We have to construct class using external injector when we know exact context
        if (empty($parameters) && $this->hasInjector($reflection)) {
            $instance = $this->getInjector($reflection)->createInjection($reflection, $context);

            if (!$reflection->isInstance($instance)) {
                throw new InjectionException("Invalid injection response for '{$reflection->getName()}'");
            }

            return $instance;
        }

        if (!$reflection->isInstantiable()) {
            throw new ContainerException("Class '{$class}' can not be constructed");
        }

        if (!empty($constructor = $reflection->getConstructor())) {
            //Using constructor with resolved arguments
            $instance = $reflection->newInstanceArgs(
                $this->resolveArguments($constructor, $parameters)
            );
        } else {
            //No constructor specified
            $instance = $reflection->newInstance();
        }

        return $instance;
    }
234791
private final static function getInstance($fqcn, $name)
    {
        $instances = self::getInstances($fqcn);

        if (!isset($instances[$name])) {
            return null;
        } else {
            return $instances[$name];
        }
    }
1162280
protected function instanciateFactorable(string $factorableClassName)
    {
        if (class_exists($factorableClassName)) {
            $service = parent::instanciateFactorable($factorableClassName);
        } elseif ($this->getContainer()->has($factorableClassName)) {
            $service = $this->getContainer()->get($factorableClassName);
        } else {
            throw new ServiceNotFoundException($factorableClassName);
        }

        return $service;
    }
1230228
public function getOrCreate($className, $params = array())
    {
        $key = $className . join('-', $params);

        if (isset($this->mapping[$key])) {
            return $this->mapping[$key];
        }

        if (method_exists($this, $this->getMethodName($className))) {
            $callback = array($this, $this->getMethodName($className));
            $instance =  call_user_func_array($callback, $params);
        } else {
            $instance = new $className;
        }

        return $this->mapping[$key] = $instance;
    }
914586
protected function resolve($abstract, array $parameters = [])
    {
        if ($this->bound($abstract)) {
            array_unshift($parameters, $this);

            return call_user_func_array($this->bindings[$abstract]['concrete'], $parameters);
        }

        $reflector = new ReflectionClass($abstract);

        if (!$constructor = $reflector->getConstructor()) {
            return new $abstract($parameters);
        }

        $constructorParams = $constructor->getParameters();

        $callParams = [];

        foreach ($constructorParams as $param) {
            if ($param->getClass()) {
                $callParams[] = $this->__invoke($param->getClass()->getName());
            }
        }

        foreach ($parameters as $key => $value) {
            $callParams[] = $value;
        }

        return $reflector->newInstanceArgs($callParams);
    }
1203014
public function makeFor(FqcnCollection $fqcnCollection, $classname)
    {
        $namespaceVisitor = new NamespaceVisitor($fqcnCollection);
        $forClassnameVisitor = new ForClassnameVisitor($fqcnCollection, $classname);
        $forParser = new Parser();
        $forParser->addVisitor($namespaceVisitor);
        $forParser->addVisitor($forClassnameVisitor);

        return $forParser;
    }
292825
public function resolve($factory=false, $parameters=[]) {
        if (!$factory && $this->instance)
            return $this->instance;

        $instance   = null;
        $definition = $this->definition;
        !$factory && $parameters = [];

        if (is_string($definition)) {                       // plain strings are class names without parameters
            if (!is_class($definition)) throw new ClassNotFoundException('Cannot resolve service "'.$this->name.'" (unknown class "'.$definition.'")');
            $instance = new $definition(...$parameters);
        }
        else if (is_object($definition)) {                  // objects may be a \Closure or an already resolved instance
            $instance = $definition instanceof \Closure ? $definition(...$parameters) : $definition;
        }
        else throw new IllegalTypeException('Cannot resolve service "'.$this->name.'" (illegal definition type: '.gettype($definition).')');

        if (!$factory)
            $this->instance = $instance;
        return $instance;
    }
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);
        }
    }
779253
public function getHydratorClassName($fqcn)
    {
        $config = new Configuration($fqcn);
        $config->setAutoGenerateProxies($this->generateProxies);
        $config->setGeneratedClassesTargetDir($this->cacheDir);

        return $config->createFactory()->getHydratorClass();
    }