Try to retrieve a service instance from the automatic resolvable array.

@param string $id The service identifier.

@return mixed The service.

@throws ContainerException If the service identifier is not a string.
517291
private function resolveAutomaticResolvable(string $id)
    {
        if (Validator::key($id)->validate($this->autoResolvable)) {
            return $this->instances[$id] = $this->autoResolve($this->autoResolvable[$id]);
        }
        return $this->autoResolve($id);
    }
1087226
public function getClub($id)
    {
        try {
            return $this->service->getClub($id);
        } catch (ServiceException $e) {
            throw new ClientException('[SERVICE] ' . $e->getMessage());
        }
    }
716891
public function get($id)
    {
        if ($this->has($id)) {
            $args = func_num_args() > 1 ? func_get_arg(1) : [];
            $this->resolve($args);
            return $this->getInstance($id, $args);
        } else {
            throw new NotFoundException(
                Message::get(Message::DI_SERVICE_NOTFOUND, $id),
                Message::DI_SERVICE_NOTFOUND
            );
        }
    }
88645
public function get($id)
    {
        if (false === $this->has($id)) {
            $errMsg = sprintf('Invalid create %s', $id);
            throw new Exception\NotFoundDoctrineObjectHydratorException($errMsg);
        }

        return clone $this->prototype[$id];
    }
557996
public static function getInstance($id = 'default')
    {
        if (!isset(static::$instances[$id])) {
            static::$instances[$id] = new self();
        }
        
        return static::$instances[$id];
    }
305770
public function getDefinition($id) {
		if (! $this->has($id)) {
			throw new Exceptions\ServiceNotFound('Unable to found the service "' . $id . '"');
		}
		
		if (! isset($this->definitions[$id])) {
			$this->definitions[$id] = $this->initDefinition($id);
		}
		
		return $this->definitions[$id];
	}
562512
private function getServiceCall($id, Reference $reference = null)
    {
        while ($this->container->hasAlias($id)) {
            $id = (string) $this->container->getAlias($id);
        }
        $id = $this->container->normalizeId($id);

        if ('service_container' === $id) {
            return '$this';
        }

        if ($this->container->hasDefinition($id) && ($definition = $this->container->getDefinition($id)) && !$definition->isSynthetic()) {
            if (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) {
                $code = 'null';
                if (!$definition->isShared()) {
                    return $code;
                }
            } elseif ($this->isTrivialInstance($definition)) {
                $code = substr($this->addNewInstance($definition, '', '', $id), 8, -2);
                if ($definition->isShared()) {
                    $code = sprintf('$this->services[\'%s\'] = %s', $id, $code);
                }
            } elseif ($this->asFiles && $definition->isShared() && !$this->isHotPath($definition)) {
                $code = sprintf("\$this->load('%s.php')", $this->generateMethodName($id));
            } else {
                $code = sprintf('$this->%s()', $this->generateMethodName($id));
            }
        } elseif (null !== $reference && ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE === $reference->getInvalidBehavior()) {
            return 'null';
        } elseif (null !== $reference && ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $reference->getInvalidBehavior()) {
            $code = sprintf('$this->get(\'%s\', /* ContainerInterface::NULL_ON_INVALID_REFERENCE */ %d)', $id, ContainerInterface::NULL_ON_INVALID_REFERENCE);
        } else {
            $code = sprintf('$this->get(\'%s\')', $id);
        }

        // The following is PHP 5.5 syntax for what could be written as "(\$this->services['$id'] ?? $code)" on PHP>=7.0

        return "\${(\$_ = isset(\$this->services['$id']) ? \$this->services['$id'] : $code) && false ?: '_'}";
    }
837276
public function find($id)
    {
        if (empty($id)) {
            throw new StorageException('Invalid id parameter.');
        }

        try {
            return $this->select(null, [self::DIAGNOSTIC_ID => $id], 1)->fetch(\PDO::FETCH_ASSOC);
        } catch (\PDOException $e) {
            throw new StorageException($e->getMessage());
        }
    }
1220692
private function resolveInstance(string $id)
    {
        if (Validator::key($id)->validate($this->instances)) {
            return $this->instances[$id];
        }
        return $this->resolveAutomaticResolvable($id);
    }
1156430
public function get($serviceId)
    {
        if (!$this->has($serviceId)) {
            throw NotFoundException::constructWithServiceId($serviceId);
        }
        try {
            return $this->pimpleContainer[$serviceId];
        } catch (\Exception $exception) {
            throw new ContainerException('Pimple container exception occurred', 0, $exception);
        }
    }
1083644
public function select($id = null)
    {
        if (!is_array($id) || !isset($id['service']) || !isset($id['method']) || empty($id['service']) || empty($id['method'])) {
            throw new \InvalidArgumentException('Invalid id argument. Must be array and containing at least service and method property.');
        }

        $serviceName = $id['service'];
        if (!isset($this->services[$serviceName])) {
            throw new \InvalidArgumentException("Service '$serviceName' is not registered in StorageProvider.");
        }

        $method = $id['method'];
        if (!empty($this->services[$serviceName]['methods']) && !in_array($method, $this->services[$serviceName]['methods'])) {
            throw new \InvalidArgumentException("Method '$method' is not registered in StorageProvider for service '$serviceName'.");
        }

        $service = $this->container->get($serviceName);
        $callable_with_arguments = array($service, $method, isset($id['arguments']) ? $id['arguments'] : null);

        return new StorageSelection($callable_with_arguments);
    }
99464
public function offsetGet($id)
    {
        if (!array_key_exists($id, $this->container)) {
            throw new InvalidArgumentException(sprintf('Identifier "%s" is not defined.', $id));
        }

        return $this->container[$id] instanceof Closure ? $this->container[$id]($this) : $this->container[$id];
    }
1083629
public function get($id, $args = null) {
		if (isset($args[2])) {
			$args = func_get_args();
			array_shift($args);
		}
		
		if (isset($this->_definitions[$id])) {
			return $this->_definitions[$id]->getService($args);
		}
		
		$locator = $this->getLocatorByServiceId($id);
		
		if ($locator !== null) {
			return $locator->get($id, $args);
		}
			
		throw new Exceptions\ServiceNotFound('Unable to found the service "' . $id . '"');
	}
537776
public function getServiceNameById($id)
    {
        $map = $this->getServiceIdNameMap();
        if (array_key_exists($id, $map)) {
            return $map[$id];
        }

        return null;
    }
954469
public final function get($className)
   {
       if (!$this->has($className)) {
           throw new NotFoundException(
               "Can't get " . $className . ": not found");
       } else if (is_callable($this->service[$className])) {
           $args = func_get_args();
           $args[0] = $this;
           try {
               $this->service[$className] = $this->service[$className](...$args);
           } catch (Throwable $e) {
               throw new ContainerException(
                   "Can't get " . $className . ": " . $e->getMessage());
           }
       }
       return $this->service[$className];
    }
449433
protected function getId($id = null)
    {
        $id = (empty($id)) ? $this->resourceId : $id;
        if (empty($id)) {
            throw new \Exception('Invalid id supplied [' . $id . ']. Operation requires valid resource id.');
        }

        return $id;
    }
685226
public function get($id)
    {
        return $this->_sendPayload(
            $this->_getService($this->_pageServiceKey)->getTemplateLayout($id)
        );
    }