Example #1
0
 /**
  * Handles the "bind --delete" command.
  *
  * @param Args $args The console arguments.
  *
  * @return int The status code.
  */
 public function handleDelete(Args $args)
 {
     $bindingToRemove = $this->getBindingByUuidPrefix($args->getArgument('uuid'));
     if (!$bindingToRemove->getContainingPackage() instanceof RootPackage) {
         throw new RuntimeException(sprintf('Can only delete bindings from the package "%s".', $this->packages->getRootPackageName()));
     }
     $this->discoveryManager->removeRootBinding($bindingToRemove->getUuid());
     return 0;
 }