unregisterNamespace() public method

Validation based on what was returned from getNamespaces has already happened in the NamespaceRegistry.
public unregisterNamespace ( string $prefix )
$prefix string The prefix to unregister.
 /**
  * {@inheritDoc}
  *
  * @api
  */
 public function unregisterNamespaceByURI($uri)
 {
     if (!$this->transport instanceof WritingInterface) {
         throw new UnsupportedRepositoryOperationException('Transport does not support writing');
     }
     $this->lazyLoadNamespaces();
     $prefix = array_search($uri, $this->userNamespaces);
     if ($prefix === false) {
         throw new NamespaceException("Namespace '{$uri}' is not currently registered");
     }
     // now check whether this is a prefix out of the defaultNamespaces in checkPrefix
     $this->checkPrefix($prefix);
     $this->transport->unregisterNamespace($prefix);
     //remove the prefix from the local userNamespaces array
     unset($this->userNamespaces[$prefix]);
 }