Puli\Manager\Api\Module\ModuleList::getRootModuleName PHP Method

getRootModuleName() public method

If the collection contains no root module, null is returned.
public getRootModuleName ( ) : string | null
return string | null The root module name or `null` if none exists.
    public function getRootModuleName()
    {
        return $this->rootModule ? $this->rootModule->getName() : null;
    }

Usage Example

コード例 #1
0
ファイル: BindCommandHandler.php プロジェクト: puli/cli
 /**
  * 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->getContainingModule() instanceof RootModule) {
         throw new RuntimeException(sprintf('Can only delete bindings from the module "%s".', $this->modules->getRootModuleName()));
     }
     $this->discoveryManager->removeRootBindingDescriptor($bindingToRemove->getUuid());
     return 0;
 }
All Usage Examples Of Puli\Manager\Api\Module\ModuleList::getRootModuleName