Decorate the service object if DecorateExtension loaded

@param  object $service
@return self
@throws LogicException if something goes wrong
@access protected
11929
protected function decorateService($service)
    {
        $extName = DecorateExtension::EXTENSION_CLASS;

        // decorate extension loaded
        if ($this->hasExtension($extName)) {
            /* @var $ext DecorateExtension */
            $ext = $this->getExtension($extName);
            $ext->decorateService($service);
        }

        return $this;
    }
888783
function set(iContainerService $service)
    {
        $name  = $service->getName();
        if ($name !== null && $this->has($name) && !$this->_attainCService($name)->isAllowOverride())
            throw new \Exception(
                "A service by the name or alias ({$name}) already exists and cannot be overridden;"
            );

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

        return $this;
    }
1050766
function withServices(array $services) {
        foreach ($services as $method => $type) {
            $this->bind($method, $type);
        }
        return $this;
    }
852624
public function addService($service)
    {
        $this->strategies[] = $service;
        $this->strategies = array_unique($this->strategies);
    }
138532
protected function getService($service)
    {
        if (!isset($this->app[$service])) {
            throw new \Exception('O serviço '.$service.' não foi registrado na aplicação!');
        }

        return $this->app[$service];
    }
750811
public function add($service, $offset = null)
    {
        if (is_object($service)) {
            if ( ! $service instanceof SplServiceRegistry) {
                $service = new SplServiceRegistry($service);
            }
        }

        if (profiler() !== false) {
            profiler()->watch('Add New Service: ' . $service->getClassName());
        }

        $this->register($service, $offset);
    }
1006511
protected function getServiceProxy(string $service): LocatorProxyInterface
    {
        return new LocatorProxy(
            $this->coreNamespaces,
            $this->projectNamespaces,
            ucfirst($service)
        );
    }
1226409
protected function load($service)
    {
        $sol = isset($this->loaded[$service]['loader'])
            ? $this->loaded[$service]['loader']
            : null;

        // Load by calling a function
        if (is_callable($sol)) {
            try {
                $this->active[$service] = $sol();
            } catch (\Exception $e) {
                throw new \Exception(
                    "CDI could not load service '$service'."
                    . "Failed in the callback that instantiates the service. "
                    . $e->getMessage()
                );
            }
        } elseif (is_object($sol)) {
            // Load by pre-instantiated object
            $this->active[$service] = $sol;
        } elseif (is_string($sol)) {
            // Load by creating a new object from class-string
            $this->active[$service] = new $sol();
        } else {
            throw new Exception("CDI could not load service '$service'. It is unknown how to load it.");
        }

        $this->$service = $this->active[$service];
        return $this->active[$service];
    }
612288
public function load($object)
    {
        if (get_class($object) !== $this->objectClass) {
            throw new \LogicException(sprintf('Invalid object type. Expected "%s" but got "%s".', $this->objectClass, get_class($object)));
        }

        $hydrator = $this->objectManager->getHydratorFor($this->objectClass);
        $hydrator->load($object);
    }
1280674
public function mockService($service, $singleton = true)
  {
    $mock = \Mockery::mock($service)->makePartial();
    $this->getContainer()->add($service, $mock, $singleton);

    return $mock;
  }
358200
public static function jsonDeserialize(string $json): self
    {
        $data = array_replace(['path' => null, 'filters' => null, 'force' => false], JSON::decode($json));

        if (!$data['path']) {
            throw new LogicException('The message does not contain "path" but it is required.');
        }

        if (!(null === $data['filters'] || \is_array($data['filters']))) {
            throw new LogicException('The message filters could be either null or array.');
        }

        return new static($data['path'], $data['filters'], $data['force']);
    }
978858
public function getApplicableAuthenticators($service = Authenticator::LOGIN)
    {
        $authenticators = $this->getAuthenticators();

        /** @var Authenticator $authenticator */
        foreach ($authenticators as $name => $authenticator) {
            if (!($authenticator->supportedServices() & $service)) {
                unset($authenticators[$name]);
            }
        }

        if (empty($authenticators)) {
            throw new LogicException('No applicable authenticators found');
        }

        return $authenticators;
    }
165199
public function export()
    {
        if ($this->config == null) {
            throw new LogicException('Context must be set before export the service.');
        }

        if ($this->dispatcher == null) {
            throw new LogicException('Dispatcher must be set before export the service.');
        }

        $this->dispatcher->exportInvoker(
            $this->getInvoker()
        );
    }
748671
protected function isTokenExpired( $service ) {
        if ( !$this->isTokenLoaded( $service ) ) {
            $this->tokens[$service] = $this->getToken( $service );
        }

        return $this->tokens[$service]->hasExpired();
    }
1294588
public function &getService($service)
    {

        $classServiceName = basename($service);
        if (isset($this->$classServiceName)) {
            return $this->$classServiceName;
        } else {
            $service = ucfirst($service);
            $factoryClass = $service . "Factory";

            if (class_exists($factoryClass)) {
                $factory = new $factoryClass();
                if ($factory instanceof ServiceFactory) {
                    if (!$this->isUnderConstruction($service)) {
                        $this->underConstruction($service);
                        $newService = $factory->create();
                        $this->constructed($service);
                    } else {
                        if(isset($this->proxyObjects[$classServiceName])) {
                            return $this->proxyObjects[$classServiceName];
                        }else{
                            return $this->$classServiceName;
                        }
                    }

                    $this->$classServiceName = $newService;
                    return $newService;
                }
            }

            if (!$this->isUnderConstruction($service)) {
                $this->underConstruction($service);
                $object = new $service();
                if ($object instanceof ServiceFactory) {
                    $newService = $object->create();
                } else {
                    $newService = $object;
                }
                $this->constructed($service);
            } else {
                if(isset($this->proxyObjects[$classServiceName])) {
                    return $this->proxyObjects[$classServiceName];
                }else{
                    return $this->$classServiceName;
                }
            }

            $this->$classServiceName = $newService;
            return $newService;
        }
    }
779536
public function grabService($service)
    {
        $container = $this->_getContainer();
        if (!$container->has($service)) {
            $this->fail("Service $service is not available in container");
        }
        return $container->get($service);
    }