/**
  * Unset a service if it is not protected
  *
  * @param   string  $name
  * @return  mixed
  * @throws  \ErrorException
  */
 public function unsetService($name)
 {
     if ($this->hasService($name)) {
         if (!$this->isProtected($name)) {
             if ($this->hasProvider($name)) {
                 $data = $this->getProvider($name);
                 if (is_object($data) && CodeHelper::implementsInterface($data, 'ServiceContainer\\ServiceProviderInterface')) {
                     $data->terminate($this);
                 }
             }
             $this->_services->offsetUnset($name);
         } else {
             throw new ErrorException(sprintf('Cannot unset protected service "%s"!', $name));
         }
     }
     return $this;
 }