Returns the service by name.

@param string $service
@return \Rawebone\Injector\Func
@throws \Rawebone\Injector\ResolutionException
179033
public function resolve($service)
    {
        if (isset($this->resolved[$service])) {
            return $this->resolved[$service];
        }

        return $this->resolved[$service] = $this->getFunc($service);
    }
1006511
protected function getServiceProxy(string $service): LocatorProxyInterface
    {
        return new LocatorProxy(
            $this->coreNamespaces,
            $this->projectNamespaces,
            ucfirst($service)
        );
    }
1085132
public function resolveServices($value)
    {
        if (is_array($value)) {
            foreach ($value as $k => $v) {
                $value[$k] = $this->resolveServices($v);
            }
        } elseif ($value instanceof Reference) {
            $value = $this->get((string) $value, $value->getInvalidBehavior());
        } elseif ($value instanceof Definition) {
            $value = $this->createService($value, null);
        } elseif ($value instanceof Expression) {
            $value = $this->getExpressionLanguage()->evaluate($value, array('container' => $this));
        }

        return $value;
    }
225785
private function resolve($name)
    {   
        // set as resolved
        $this->resolved[$name] = true;
        
        // resolve the service
        if (is_string($this->instances[$name]) && class_exists($this->instances[$name])) 
        {
            
            $object = $this->instances[$name];

            return new $object();

        }
        elseif(is_callable($this->instances[$name]))
        {

            $callable = $this->instances[$name];

            return $callable();

        }    

        return $this->instances[$name];
    }
602093
protected function propagate($service)
    {
        // Propagate the service manager
        if ($service instanceof ServiceLocatorAwareInterface) {
            $service->setServiceLocator($this->getServiceLocator());
        }

        // Propagate the logger service
        if ($service instanceof LoggerAwareInterface) {
            $logger = null;
            if ($this instanceof TaoLoggerAwareInterface) {
                $logger = $this->getLogger();
            } else {
                if ($this->getServiceLocator()->has(LoggerService::SERVICE_ID)) {
                    $logger = $this->getServiceLocator()->get(LoggerService::SERVICE_ID);
                }
            }
            if (!is_null($logger)) {
                $service->setLogger($logger);
            }
        }

        return $service;
    }
1317099
public function get($id)
    {
        if (isset($this->resolved[$id])) {
            return $this->resolved[$id];
        }
        $definition = null;
        if (isset($this->definitions[$id])) {
            $definition = $this->definitions[$id];
        }
        foreach ($this->resolvers as &$resolver) {
            if (is_string($resolver)) {
                $resolver = new $resolver;
            }
            if (!$resolver->supports($id, $definition)) {
                continue;
            }
            $service = $resolver->resolve(
                $this,
                $id,
                $definition
            );
            if (false !== $service) {
                if (isset($this->extensions[$id]) && is_array($this->extensions[$id])) {
                    foreach ($this->extensions[$id] as $extension) {
                        $service = $extension($service, $this);
                    }
                }
                if (isset($this->shared[$id])) {
                    $this->resolved[$id] = $service;
                }
                return $service;
            }
        }

        throw new NotFoundException(
            sprintf('Service \'%s\' not found', $id)
        );
    }
737784
public function getServiceEndpoint( $service ) {
        switch ( $service ) {
            case 'organization':
                return $this->organizationUrl;
            case 'discovery':
                return $this->discoveryUrl;
            case 'sts':
            case 'login':
                return $this->loginUrl;
            default:
                return $service;
        }
    }
678469
protected function makeService($name)
    {
        $config = $this->getConfig($name);

        // First we will check by the service name to see if an extension has been
        // registered specifically for that service. If it has we will call the
        // Closure and pass it the config allowing it to resolve the service.
        if (isset($this->extensions[$name])) {
            return call_user_func($this->extensions[$name], $config, $name);
        }

        $config = $this->getDbConfig($name);
        $type = $config['type'];

        // Next we will check to see if a type extension has been registered for a service type
        // and will call the factory Closure if so, which allows us to have a more generic
        // resolver for the service types themselves which applies to all services.
        if (isset($this->types[$type])) {
            return $this->types[$type]->make($name, $config);
        }

        throw new InvalidArgumentException("Unsupported service type '$type'.");
    }
1358691
public function getService($name = null)
    {
        $name = $name ?: $this->defaultService;

        if (!$name) {
            throw new \RuntimeException(sprintf(
                'You must configure a default %s service, registered %s services: "%s"',
                $this->serviceType, $this->serviceType,
                implode('", "', array_keys($this->services))
            ));
        }

        if (isset($this->services[$name])) {
            return $this->services[$name];
        }

        $this->assertServiceExists($name);
        $this->services[$name] = $this->container->get($this->serviceMap[$name]);

        return $this->services[$name];
    }
118517
public function getConnectedAccountForService($service) {
		$accounts = $this->getDocument()->getGraph()->getNodesByType('coid://accountgateways.cloudobjects.io/Account');
		foreach ($accounts as $a) {
			if ($a->getProperty('coid://accountgateways.cloudobjects.io/isForService')
				&& $a->getProperty('coid://accountgateways.cloudobjects.io/isForService')->getId()==$service) return $a;
		}
		return null;
	}
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;
    }
48086
public function registerObject($service, $object)
    {
		if (!is_object($object)) {
			throw new ResolutionException("Service '$service' cannot be register as it's value is invalid");
		}

        $this->services[$service] = function () use ($object) { return $object; };
    }
1115378
private function getService($class)
    {
        if (!array_key_exists($class, $this->services)) {
            $this->services[$class] = new $class($this->getClient(), $this->getLogger());
        }

        return $this->services[$class];
    }
818937
public function get($name)
    {
        if(array_key_exists($name, $this->services))
            return $this->services[$name];

        return $this->services[$name] = $this->solve('service', $name, array($this));
    }
910532
final public function getService($name)
    {
        if (method_exists($this, 'getServiceProviders')) {
            $services = $this->getServices();

            if (isset($services[$name])) {
                return $services[$name];
            } else {
                throw new LogicException(sprintf(
                    'Attempted to read non-existing service %s', $name
                ));
            }

        } else {
            throw new RuntimeException(sprintf(
                'There are no services'
            ));
        }
    }
195834
protected function getService($service) {
		$service = strtolower($service);
		$services = $this->getServices();
		if (!isset($services[$service])) {
			throw new EAuthException(Yii::t('eauth', 'Undefined service name: {service}.', array('{service}' => $service)), 500);
		}
		return $services[$service];
	}
520574
public function getService($name)
    {
        if (!$this->serviceManager) {
            throw new Exception\UndefinedReferenceException('Cannot get service without an service manager instance!');
        }

        return $this->serviceManager->get($name);
    }