Check available name for service
@param string $serviceType
@return string
@throw RuntimeException
7105
protected function checkServiceType($serviceType)
    {
        $reflection = new \ReflectionObject($this);
        $constants = $reflection->getConstants();
        if (!in_array($serviceType, $constants)) {
            throw new RuntimeException('The type of service does not support: ' . $serviceType);
        }
        return $serviceType;
    }
268440
public function getFilter($name)
    {
        if (!array_key_exists($name, $this->filters)) {
            throw new \RuntimeException('There is no filter for the name "' . $name . '" registered.');
        }

        return $this->filters[$name];
    }
622899
public function getServiceNamesByType($types, $only_active = false)
    {
        $names = [];
        $map = $this->getServiceNameTypeMap($only_active);
        if (is_string($types)) {
            $types = array_map('trim', explode(',', trim($types, ',')));
        }
        foreach ($map as $name => $type) {
            if (false !== array_search($type, $types)) {
                $names[] = $name;
            }
        }

        return $names;
    }
156493
public function getTypeByName($name)
    {
        foreach ($this->collection as $type) {
            /** @var $type TypeInterface */
            if ($type->getName() === $name) {
                return $type;
            }
        }

        throw new \RuntimeException(\sprintf('No type found for name %s, list: %s', \var_export($name, true), \var_export($this->collection, true)));
    }
175751
protected function getWsdlFileName($serviceName)
	{
		if(null === $this->cacheInstance)
		{
			$this->createCacheInstance();
		}
		$cacheAlias = 'WSDL' . $serviceName;
		$fileName = $this->cacheInstance->getFileName($cacheAlias);
		if(!is_file($fileName))
		{
			$this->getWsdlNoCache($serviceName);
		}
		return $fileName;
	}
214484
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            return $this->registry->get($serviceName);
        }

        $serviceConfig = $this->classes->resolve($serviceName, null);

        if ($serviceConfig == null) {
            throw new \DICIT\UnknownDefinitionException($serviceName);
        }

        try {
            return $this->loadService($serviceName, $serviceConfig->extract());
        }
        catch (\DICIT\UnknownDefinitionException $ex) {
            throw new \RuntimeException(
                sprintf("Dependency '%s' not found while trying to build '%s'.",
                    $ex->getServiceName(), $serviceName));
        }
    }
1234808
public function getService( $type )
	{
		if(!isset($this->_services[$type])) {
			throw new MShop_Order_Exception( sprintf( 'Service of type "%1$s" not available', $type ) );
		}

		return $this->_services[$type];
	}
1196509
public function getKeyExchange($type)
    {
        if (!isset($this->keyExchanges[$type])) {
            throw new \RuntimeException('Key exchange not configured: ' . $type);
        }
        return $this->keyExchanges[$type];
    }
586221
public function getName()
    {
        if (!null === $this->name) {
            $errMsg = 'service name not exists';
            throw new Exception\InvalidServiceConfigException($errMsg);
        }
        return $this->name;
    }
390731
protected function getResourceType($name)
    {
        if (!isset($this->types[$name])) {
            $template = $this->parser->parse($name);
            if ($template instanceof TemplateReferenceInterface) {
                $this->types[$name] = $template->get('engine');
            }
        }
        if (!isset($this->types[$name])) {
            throw new \RuntimeException("Could not load the given resource.");
        }

        return $this->types[$name];
    }
352717
public static function loadService(
        EngineTypeInterface $engine,
        $type,
        $name = null
    ) {
        $classname = static::serviceClassname($type);

        if (!class_exists($classname)) {
            throw new \RuntimeException(
                sprintf("Service class %s doesn't exist.", $classname)
            );
        }

        return new $classname($engine, $name);
    }
387819
protected function requireServiceEventType()
    {
        return $this->serviceName !== null && $this->serviceEventType !== null && $this->repoToken !== null;
    }
455796
protected function lazyLoad(string $eventType): void
    {
        if (isset($this->serviceIds[$eventType])) {
            foreach ($this->serviceIds[$eventType] as $args) {
                list($serviceId, $method, $priority) = $args;
                $service = $this->container->get($serviceId);
                $key = sprintf('%s.%s', $serviceId, $method);
                if (!isset($this->services[$eventType][$key])) {
                    $this->addHandler($eventType, [$service, $method], $priority);
                } elseif ($service !== $this->services[$eventType][$key]) {
                    parent::removeHandler($eventType, [$this->services[$eventType][$key], $method]);
                    $this->addHandler($eventType, [$service, $method], $priority);
                }
                $this->services[$eventType][$key] = $service;
            }
        }
    }
1033189
public static function formTypeToString($formType)
    {
        if ($formType instanceof FormTypeInterface) {
            return get_class($formType);
        }

        if (is_string($formType)) {
            return $formType;
        }

        throw new RuntimeException(
            sprintf(
                'Unable to determine form type for %s. Expected string or instance of %s',
                is_object($formType) ? get_class($formType) : gettype($formType),
                FormInterface::class
            )
        );
    }
75886
public function getType()
    {
        $sql = $this->getSql();

        $type = strtok(strtolower(trim($sql)), ' ');
        $type = preg_replace ('/[^a-z]/i', '', $type);

        $allowedTypes = [
            self::QUERY_TYPE_SELECT,
            self::QUERY_TYPE_INSERT,
            self::QUERY_TYPE_UPDATE,
            self::QUERY_TYPE_DELETE,
            self::QUERY_TYPE_TRUNCATE,
        ];

        if (!in_array($type, $allowedTypes)) {
            throw new RuntimeException('Invalid query type');
        }

        return $type;
    }
204368
public function get($serviceKey)
    {
        $serviceId = $this->getServiceId($serviceKey);
        if (!isset($this->services[$serviceId])) {
            $this->services[$serviceId] = $this->load($serviceId, $serviceKey);
        }
        return $this->services[$serviceId];
    }
474232
public function getSignatureAlgorithm($type)
    {
        if (!isset($this->signatureAlgorithms[$type])) {
            throw new \RuntimeException('Algorithm not configured: ' . $type);
        }
        return $this->signatureAlgorithms[$type];
    }