Returns true if the service is in the container, or resolves to an
autoloadable class name.

@param string $service
557447
private function hasService(string $service): bool
    {
        if ($this->container instanceof ContainerInterface && $this->container->has($service)) {
            return true;
        }

        return class_exists($service);
    }
875174
public function setService($service)
    {
        Service::isValid($service);

        $this->service = $service;

        if ($service === Service::EP) {
            $this->set(Config::T200, 'T13');
            $this->set(Config::T206, $service);
        } elseif ($service === Service::SHD || $service === Service::FDF) {
            $this->set(Config::T200, $service);
            $this->set(Config::T750, Service::getLabel($service));
        }

        return $this;
    }
592387
private function resolve($service, $method)
    {
        if (is_callable($service)) {
            return $service;
        }

        if (is_callable([$service, $method])) {
            return [$service, $method];
        }

        return null;
    }
1112992
public function setService($service)
    {
        $prefix = $this->getConfig('service_class_prefix');

        $this->service[$service] = $this->createInstance($service, $prefix, [$this->client]);
    }
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
1078832
public function isAutoload($autoload = null)
    {
        if ($autoload !== null) {
            $this->autoload = (bool) $autoload;
        }

        return $this->autoload;
    }
1202715
protected function urlService($service)
	{
		if($service instanceof Uri)
		{
			$uri = $service->get();
		}
		else
		{
			$uri = $service;
		}
		return $this->baseUrl .'/'. ltrim($uri, '/');
	}
840133
public function getService($service)
    {
        foreach ($this->queue as $extension) {
            $new = call_user_func($extension, $service, $this->container);

            if ($new) {
                $service = $new;
            }
        }

        return $service;
    }
274046
public function addService($service)
    {
        if (in_array($service, $this->allServices)) {
            $this->services[] = $service;
        }

        return $this;
    }
1346490
public function handleService($service, $resource = null)
    {
        $request = new ServiceRequest();

        return $this->handleServiceRequest($request, $service, $resource);
    }
774043
public function registerService($service, $name = '') {
        if (empty($name)) {
            $name = Assist::classNameShort($service);
        }

        static::$container->offsetSet(strtolower($name), $service);
    }
1036890
public function beforeWebMethod($service)
	{
		$safeMethods=array(
			'login',
			'getContacts',
		);
		$pattern='/^('.implode('|',$safeMethods).')$/i';
		if(!Yii::app()->user->isGuest || preg_match($pattern,$service->methodName))
			return true;
		else
			throw new CException('Login required.');
	}
1175350
public function registerService($service, $class)
    {
        $this[$service] = function ($app) use ($class) {
                $inst = new $class;
                if ($inst instanceof FactoryInterface) {
                    return $inst->create($app);
                } else {
                    return $inst;
                }
            };
    }
1165869
protected function resolveDatabaseServiceInstance($service = null)
    {
        /** @var EngineType $engine */
        $engine = $this->getEngineInstance();
        $services = $engine->getServiceInstanceByGroup('database');

        if (!isset($service) || !isset($services[$service])) {
            if (count($services) > 1) {
                $options = array_keys($services);
                $service = $this->doAsk(
                    new ChoiceQuestion(
                        'Select the database service to use for import: ',
                        $options
                    )
                );
            } else {
                $options = array_keys($services);
                $service = reset($options);
            }
        }

        if (!isset($services[$service])) {
            throw new \RuntimeException(
                'Unable to resolve database service.'
            );
        }

        return $services[$service];
    }
227048
public function initializeConfig($service)
    {
        if (function_exists('config_path') &&
            file_exists(config_path('pushnotification.php')) &&
            function_exists('app')
        ) {
            $configuration = app('config')->get('pushnotification');
        } else {
            $configuration = include(__DIR__ . '/Config/config.php');
        }

        if (!array_key_exists($service, $configuration)) {
            throw new PushNotificationException("Service '$service' missed in config/pushnotification.php");
        }
        return $configuration[$service];
    }
685639
public function hasService($name)
    {
        try {
            $service = $this->getService($name);
            return !empty($service);
        } catch (\Vegas\DI\Service\Exception $ex) {
            return false;
        }
    }
539214
public function initialized($id)
    {
        $id = strtolower($id);

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

        if (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return isset($this->services[$id]);
    }