PocketMine-MP 5.35.1 git-f412a390b8f63d0311cc1d1c81046404153b8440
Loading...
Searching...
No Matches
pocketmine\command\CommandAliasMap Class Reference
+ Collaboration diagram for pocketmine\command\CommandAliasMap:

Public Member Functions

 bindAlias (string $commandId, string $newAlias, bool $override)
 
 getAliases (string $commandId)
 
 getAllAliases ()
 
 getMergedAliases (string $commandId, CommandAliasMap $fallbackMap)
 
 getPreferredAlias (string $commandId, CommandAliasMap $fallbackMap)
 
 resolveAlias (string $alias)
 
 unbindAlias (string $alias)
 
 unbindAliasesForCommand (string $commandId)
 

Detailed Description

Definition at line 33 of file CommandAliasMap.php.

Member Function Documentation

◆ bindAlias()

pocketmine\command\CommandAliasMap::bindAlias ( string $commandId,
string $newAlias,
bool $override )

Definition at line 65 of file CommandAliasMap.php.

◆ getAliases()

pocketmine\command\CommandAliasMap::getAliases ( string $commandId)

Returns all (non-conflicted) aliases for the command.

Returns
string[] @phpstan-return list<string>

Definition at line 114 of file CommandAliasMap.php.

◆ getAllAliases()

pocketmine\command\CommandAliasMap::getAllAliases ( )
Returns
string[]|string[][] @phpstan-return array<string, string|list<string>>

Definition at line 168 of file CommandAliasMap.php.

◆ getMergedAliases()

pocketmine\command\CommandAliasMap::getMergedAliases ( string $commandId,
CommandAliasMap $fallbackMap )

Returns a list of all the names a command could be invoked by. Aliases from this map override the fallback map. The command ID is also included, since that can always be used to invoke a command.

Returns
string[] @phpstan-return non-empty-list<string>

Definition at line 138 of file CommandAliasMap.php.

◆ getPreferredAlias()

pocketmine\command\CommandAliasMap::getPreferredAlias ( string $commandId,
CommandAliasMap $fallbackMap )

Returns a preferred alias for the given command ID. Used for displaying errors and help tips. For example, the user might not have /help bound, but might have a different alias for it that's more convenient than /pocketmine:help.

Definition at line 159 of file CommandAliasMap.php.

◆ resolveAlias()

pocketmine\command\CommandAliasMap::resolveAlias ( string $alias)

Returns the ID of the command bound to the given alias. If there are conflicting commands bound, an array of all the bound command IDs will be returned. If the alias is not bound, null will be returned.

Returns
string|string[]|null @phpstan-return string|list<string>|null

Definition at line 126 of file CommandAliasMap.php.

◆ unbindAlias()

pocketmine\command\CommandAliasMap::unbindAlias ( string $alias)

Definition at line 74 of file CommandAliasMap.php.

◆ unbindAliasesForCommand()

pocketmine\command\CommandAliasMap::unbindAliasesForCommand ( string $commandId)

Definition at line 88 of file CommandAliasMap.php.


The documentation for this class was generated from the following file: