Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function unregisterNamespace($prefix)
 {
     if (!$this->transport instanceof WritingInterface) {
         throw new UnsupportedRepositoryOperationException('Transport does not support writing');
     }
     $this->lazyLoadNamespaces();
     $this->checkPrefix($prefix);
     if (!array_key_exists($prefix, $this->userNamespaces)) {
         // we already checked whether this is a prefix out of the defaultNamespaces in checkPrefix
         throw new NamespaceException("Prefix {$prefix} is not currently registered");
     }
     $this->transport->unregisterNamespace($prefix);
     //remove the prefix from the local userNamespaces array
     unset($this->userNamespaces[$prefix]);
 }