Retrieves a service by name

@param string $name The service name

@return mixed

@throws ServiceNotFoundException When the service is not found
772430
public function get($name)
    {
        if (!isset($this->services[$name])) {
            throw ServiceNotFoundException::fromName($name);
        }

        return $this->services[$name]($this);
    }
733895
public function get(string $name): AbstractCommand
	{
		if (!$this->has($name))
		{
			throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name));
		}

		return $this->container->get($this->commandMap[$name]);
	}
784839
public function getService($name)
    {
        // If we haven't created this service, we'll create it based on the config provided.
        // todo: Caching the service is causing some strange PHP7 only memory issues.
//        if (!isset($this->services[$name])) {
        $service = $this->makeService($name);

//            if ($this->app->bound('events')) {
//                $connection->setEventDispatcher($this->app['events']);
//            }

        $this->services[$name] = $service;

//        }

        return $this->services[$name];
    }
761353
public function get($id)
    {
        if ($this->has($id) == false) {
            throw new ServiceNotFoundException($id); 
        } 

        if (\is_object($this->services[$id]) == false || method_exists($this->services[$id], '__invoke') == false) {
            return $this->services[$id];
        }
        $this->services[$id] = $this->services[$id]($this); 
    
        return $this->services[$id];
    }
1161915
public function getContainer($name)
    {
        if (!array_key_exists($name, $this->containers)) {
            throw new ContainerNotFoundException("No container with name '{$name}' found");
        }

        return $this->containers[$name];
    }
1200131
public function get($name)
    {
        if (!$this->has($name)) {
            throw new ItemNotFoundException($name);
        }

        return $this->items[$name];
    }
134278
public function get($name)
    {
        return isset($this->routes[$name]) ? $this->routes[$name] : null;
    }
547288
private function getService(string $name, array $params = []): ?IService
    {
        if (array_key_exists($name, $this->servicesInstances)) {
            return $this->servicesInstances[$name];
        }

        $serviceConfig = $this->getServiceConfig($name);
        if ($serviceConfig === null) {
            return null;
        }

        $class = $serviceConfig['class'];
        unset($serviceConfig['class']);
        $serviceConfig = array_merge($serviceConfig, isset($params[0]) && \is_array($params[0]) ? $params[0] : []);

        if (!class_exists($class)) {
            throw new InvalidConfigException(sprintf('Class %s does not exists', $class));
        }

        if (\is_subclass_of($class, BaseModelService::class)
            || \is_subclass_of($class, BaseControllerService::class)
        ) {
            $service = new $class($this, $serviceConfig);
        } else {
            $service = new $class($serviceConfig);
        }

        if (!($service instanceof IService)) {
            throw new InvalidConfigException('Service class must implement `' . IService::class . '`.');
        }

        return $this->servicesInstances[$name] = $service;
    }
580636
public static function get($name)
    {
        if (array_has(self::$filters, 'app.'.$name)) {
            return ['app', array_get(self::$filters, 'app.'.$name)];
        } elseif (array_has(self::$filters, 'route.'.$name)) {
            return ['route', array_get(self::$filters, 'route.'.$name)];
        }

        exception(MiddlewareNotFoundException::class, $name);
    }
950682
public function getByName($name)
    {
        return isset($this->names[$name]) ? $this->names[$name] : null;
    }
1330320
public function getService($name)
    {
        if ($this->has($name)) {
            return $this->_widgets[$name];
        } else {
            $this->throwNotFound($name);
            return false;
        }
    }
142693
public function getByName($name)
    {
        if (isset($this->searchServices[$name])) {
            return $this->searchServices[$name];
        } else {
            throw new UnknowSearchNameException($name);
        }
    }
1037119
protected function _attainCService($name)
    {
        $name   = $this->getExtended($name);

        $cName  = $this->_normalizeName($name);
        $return = (isset($this->services[$cName])) ? $this->services[$cName] : false;

        // Aggregate Feature:
        if ($return === false) {
            ## Looking in Aggregate Feature Services
            /** @var iServiceFeatureAggregate $inService */
            foreach ($this->services_aggregate as $inService)
                if ($inService->canCreate($name))
                    return $inService->withServiceName($name);
        }

        return $return;
    }
1123632
private function service($name)
    {
        if (!isset($this->registry[$name])) {
            if (isset(self::$services[$name])) {
                $this->registry[$name] = new self::$services[$name]($this);
            } else {
                throw new InvalidArgumentException(sprintf('Service %s does not implement', $name));
            }
        }

        return $this->registry[$name];
    }
231531
public function getProvider($name)
    {
        return $this->hasProvider($name) ?
            $this->_services_providers->offsetGet($name) : null;
    }
926211
public Object service(String name) {
        Object service = this.services.get(name);
        if (service == null) {
            throw new IllegalArgumentException("Service '" + name + "' not found");
        }
        return service; 
    }
55618
public function getConnection($name = null)
    {
        $this->serviceContext = static::CONNECTION_CONTEXT;
        $result = parent::getConnection($name);
        $this->serviceContext = null;
        return $result;
    }