Puli\Manager\Api\Module\ModuleManager::hasModule PHP Method

hasModule() public method

Returns whether the manager has the module with the given name.
public hasModule ( string $name ) : boolean
$name string The module name.
return boolean Whether the manager has a module with that name.
    public function hasModule($name);

Usage Example

Example #1
0
 /**
  * Handles the "module --delete" command.
  *
  * @param Args $args The console arguments
  *
  * @return int The status code
  */
 public function handleDelete(Args $args)
 {
     $moduleName = $args->getArgument('name');
     if (!$this->moduleManager->hasModule($moduleName)) {
         throw new RuntimeException(sprintf('The module "%s" is not installed.', $moduleName));
     }
     $this->moduleManager->removeModule($moduleName);
     return 0;
 }