@param string $service

@return bool
777513
public function hasCSRFState(string $service):bool {
		return isset($this->states[$service]) && null !== $this->states[$service];
	}
812961
public function hasService(/*# string */ $id = '')/*# : bool */
    {
        $sid = $this->getSectionId($id);

        // direct match
        if ($this->has($sid)) {
            return true;
        }

        // autoclass
        if ($this->autoClassName($id)) {
            return true;
        }

        // translation
        if ($this->serviceTranslation($id)) {
            return true;
        }

        return false;
    }
1084363
public function hasCSRFState(string $service):bool{
		return isset($_SESSION[$this->stateVar], $_SESSION[$this->stateVar][$service]);
	}
100247
protected function validate(string $service)
    {
        throw_unless(Arr::exists(config('shield.services'), $service), UnknownServiceException::class, sprintf('Service [%s] not found.', $service));
        throw_unless(Arr::exists(config('shield.services.' . $service), 'driver'), UnknownServiceException::class, sprintf('Service [%s] must have a driver.', $service));

        $service = app(config('shield.services.' . $service . '.driver'));

        throw_unless($service instanceof Service, UnsupportedDriverException::class, sprintf('Driver [%s] must implement [%s].', get_class($service), Service::class));

        return $service;
    }
1314454
public static function service(string $service)
    {
        if (!array_key_exists($service, self::$available_services)) {
            throw (new ServiceNotFoundException(sprintf(
                '"%s" is not registered as a service.',
                $service
            )))->setServiceName($service);
        }

        $service_class = static::$available_services[$service];

        $config = static::$config['services'][$service] ?? null;

        if (is_null($config)) {
            throw (new ServiceConfigurationNotFoundException(sprintf(
                '"%s" configuration not found.',
                $service
            )))->setServiceName($service);
        }

        return $service_class::configure($config);
    }
118309
public function getServiceDescription($service)
    {
        if ($this->serviceIsObject($service)) {
            return get_class($service);
        }
        return $this->formatServiceDescription($service, is_scalar($service));
    }
1149349
public function getService($service = null)
    {
        if ( $service and ! array_key_exists($service, $this->service) )
        {
            $this->setService($service);
        }

        $this->setToken();

        return $this->service[$service];
    }
467617
public function accept()
    {
        /* @var $serviceId string|object */
        $serviceId = $this->current();
        if (in_array($serviceId, $this->getIdsOfServicesThatAreDefinedInApplication())) {
            return true;
        }
        if ($this->startsWithPrefix($serviceId, $this->getPrefixesOfApplicationServices())) {
            return true;
        }
        return false;
    }
558638
public function has(/*# string */ $id)/*# : bool */
    {
        if (static::isServiceId($id)) {
            return $this->getRealContainer()->has(static::getRawId($id));
        }
        return false;
    }
592387
private function resolve($service, $method)
    {
        if (is_callable($service)) {
            return $service;
        }

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

        return null;
    }
757488
public function isReadOnlyService()
    {
        if ($this->def->getService() === null) {
            return false;
        }

        return $this->def->getService()->getReadOnly();
    }
7847
public function hasAccessToken(string $service):bool{
		return isset($_SESSION[$this->sessionVar], $_SESSION[$this->sessionVar][$service]);
	}
1179038
public function resolve($service)
	{
		if (!isset($this->services[$service])) {
			throw new ResolutionException("Could not resolve service '$service'");
		}

		return new Func($this->services[$service]);
	}
1166411
public function hasAccessToken($service)
    {
        $service = $this->normalizeServiceName($service);

        $tokens = $this->sessionScope->get(self::SESSION_TOKEN);
        return isset($tokens[$service]);
    }
466738
public function get($service)
    {
        return $this->has($service) ? $this->container->get($service) : null;
    }
1059974
public function admin_remove_service_confirmation($service) {
        global $CFG;
        $optionsyes = array('id' => $service->id, 'action' => 'delete',
            'confirm' => 1, 'sesskey' => sesskey());
        $optionsno = array('section' => 'externalservices');
        $formcontinue = new single_button(new moodle_url('service.php', $optionsyes),
                        get_string('delete'), 'post');
        $formcancel = new single_button(
                        new moodle_url($CFG->wwwroot . "/" . $CFG->admin . "/settings.php", $optionsno),
                        get_string('cancel'), 'get');
        return $this->output->confirm(get_string('deleteserviceconfirm', 'webservice', $service->name),
                $formcontinue, $formcancel);
    }
1213757
public function url($service)
    {
        $url = 'index.php?option=com_connect&view=login&server='.$service;

        if (AnRequest::get('get.return', 'cmd')) {
            $url .= '&return='.AnRequest::get('get.return', 'raw');
        }

        return route($url);
    }