Default alternations to the service object.

@param DockerService $service
The docker service object.

@return DockerService
The alter service.
555675
protected function alterService(DockerService $service)
    {
        if ($this->internal) {
            $service
                ->setNetworks([
                    'internal'
                ])
                ->setlabels([
                    'traefik.enable=false'
                ]);

            if ($this->bindPorts) {
                $service->setPorts(
                    $this->getPorts('0000')
                );
            }
        } else {
            $service->setPorts($this->getPorts());
        }

        return $service;
    }
852319
public function getService($service)
    {
        $service = $this->mapServiceName($service);

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

        return $this->services[$service] = $this->createService($service);
    }
557447
private function hasService(string $service): bool
    {
        if ($this->container instanceof ContainerInterface && $this->container->has($service)) {
            return true;
        }

        return class_exists($service);
    }
590460
public function getService($service)
    {
        if (!isset($this->services[$service])) {
            throw new \InvalidArgumentException(sprintf('Service %s not found', $service));
        }
        return $this->services[$service];
    }
1326238
private function createContainer($settings)
    {
        if (is_string($settings)) {
            return $this->createContainerFromString($settings);
        }

        if (is_array($settings)) {
            return $this->createContainerFromArray($settings);
        }

        throw new WrongServicesConfigurationException(
            sprintf('`services` must be either string or an array, but `%s` given.', gettype($settings))
        );
    }
1337499
public function propagate($service)
    {
        if(is_object($service) &&  ($service instanceof ServiceLocatorAwareInterface)){
            $service->setServiceLocator($this);
        }
        return $service;
    }
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;
        }
    }
1202715
protected function urlService($service)
	{
		if($service instanceof Uri)
		{
			$uri = $service->get();
		}
		else
		{
			$uri = $service;
		}
		return $this->baseUrl .'/'. ltrim($uri, '/');
	}
968717
public function setServices($services)
    {
        $allowedValues = $this->getServicesAllowableValues();
        if (array_diff($services, $allowedValues)) {
            throw new \InvalidArgumentException(
                sprintf(
                    "Invalid value for 'services', must be one of '%s'",
                    implode("', '", $allowedValues)
                )
            );
        }
        $this->container['services'] = $services;

        return $this;
    }
615035
public static function getContainer()
    {
        if (!self::$container) {
            self::$container = new ServiceContainer();
            self::provideServices();
        }
        return self::$container;
    }
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];
    }
731890
public function set(string $id, $service)
    {
        if ($this->frozen) {
            throw new FrozenContainerException(
                "The container is frozen and is not possible to define the new service \"{$id}\"."
            );
        }

        $this->definitions[$id] = $service;

        // clean alias and internal cache
        unset($this->services[$id]);
        unset($this->aliases[$id]);

        return $this;
    }
5972
protected function getCommonService() {
		if ($this->service === null) {
			if ($this->arguments === null) {
				$this->service = $this->initService();
			} else {
				$args = $this->normalizeArgs($this->arguments);
				$args = $this->processArgs($args);
				
				$this->service = $this->initService($args);
			}
		}
		
		return $this->service;
	}
427556
public function set($name, $service)
    {
        if (isset($this->registry[$name])) {
            unset($this->registry[$name]);
        }
        if (isset($this->instances[$name])) {
            unset($this->instances[$name]);
        }
        if (null === $service) {
            return $this;
        }
        if (! is_string($service)) {
            $this->instances[$name] = $service;

            return $this;
        }
        $this->registry[$name] = $service;

        return $this;
    }
960678
public function clearAuthorizationState($service)
    {
        $service = $this->normalizeServiceName($service);

        $states = $this->sessionScope->get(self::SESSION_STATE);
        if (array_key_exists($service, $states)) {
            unset($states, $service);
        }
        $this->sessionScope->set(self::SESSION_STATE, $states);

        return $this;
    }
1357299
public function buildServiceTable($services)
    {
        $table = new TableHelper;
        $table->setHeaders($this->buildTableHeaders());
        $table->setRows($this->buildTableRows($services));
        return $table;
    }
267425
protected function getService( $service){
        $rest = new utils\rest\RestAuth( $this->application->getFreeboxApiHost() . $service);
        $rest->setSessionToken( $this->application->getSessionToken());
        return $rest;
    }