コード例 #1
0
 /**
  * Handles the "puli type --delete" command.
  *
  * @param Args $args The console arguments.
  *
  * @return int The status code.
  */
 public function handleDelete(Args $args)
 {
     $typeName = $args->getArgument('name');
     if (!$this->discoveryManager->hasRootTypeDescriptor($typeName)) {
         throw new RuntimeException(sprintf('The type "%s" does not exist in the package "%s".', $typeName, $this->packages->getRootPackageName()));
     }
     $this->discoveryManager->removeRootTypeDescriptor($typeName);
     return 0;
 }