public function add($id, $service, $replace = false)
    {
        if ($this->has($id) == true && $replace == false) {           
            throw new ServiceExistsException($id);
        }
        $this->services[$id] = $service;
    }
public function add($id, $service, $replace = false)
    {
        if ($this->has($id) == true && $replace == false) {           
            throw new ServiceExistsException($id);
        }
        $this->services[$id] = $service;
    }
public function add ( $ id , $ service , $ replace = false ) { if ( $ this -> has ( $ id ) == true && $ replace == false ) { throw new ServiceExistsException ( $ id ) ; } $ this -> services [ $ id ] = $ service ; }
Add service to container

@param string $id Service id
@param mixed $service Service value
@param boolean $replace Replace service if exists
@throws ServiceExistsException If replace is false and  service exists in container
@return void
Add service to container