public function addService(Service $service)
    {
        if (array_key_exists($service->getName(), $this->services)) {
            throw new KeyTakenInSetException($service->getName(), 'services');
        }

        $this->services[$service->getName()] = $service;

        return $this;
    }
public function addService(Service $service)
    {
        if (array_key_exists($service->getName(), $this->services)) {
            throw new KeyTakenInSetException($service->getName(), 'services');
        }

        $this->services[$service->getName()] = $service;

        return $this;
    }
public function addService ( Service $ service ) { if ( array_key_exists ( $ service -> getName ( ) , $ this -> services ) ) { throw new KeyTakenInSetException ( $ service -> getName ( ) , 'services' ) ; } $ this -> services [ $ service -> getName ( ) ] = $ service ; return $ this ; }
Adds service.

@param Service $service

@return $this

@throws KeyTakenInSetException
Adds service .