BaseSubCommand
in package
implements
IArgumentable, IRunnable
Uses
ArgumentableTrait
Interfaces, Classes, Traits and Enums
- IArgumentable
- IRunnable
- Interface IRunnable
Table of Contents
- $currentSender : CommandSender
- $parent : BaseCommand
- $usageMessage : string
- $aliases : array<string|int, mixed>
- $argumentList : array<string|int, mixed>
- $constraints : array<string|int, mixed>
- $description : string
- $name : string
- $permission : string|null
- $requiredArgumentCount : array<string|int, mixed>
- __construct() : mixed
- addConstraint() : void
- generateUsageMessage() : string
- getAliases() : array<string|int, string>
- getArgumentList() : array<string|int, array<string|int, BaseArgument>>
- getConstraints() : array<string|int, BaseConstraint>
- getDescription() : string
- getName() : string
- getOwningPlugin() : Plugin
- getPermission() : string|null
- getUsageMessage() : string
- hasArguments() : bool
- hasRequiredArguments() : bool
- onRun() : void
- parseArguments() : array<string|int, mixed>
- registerArgument() : void
- sendError() : void
- sendUsage() : void
- setPermission() : void
- testPermissionSilent() : bool
- prepare() : void
- This is where all the arguments, permissions, sub-commands, etc would be registered
Properties
$currentSender
protected
CommandSender
$currentSender
$parent
protected
BaseCommand
$parent
$usageMessage
protected
string
$usageMessage
$aliases
private
array<string|int, mixed>
$aliases
$argumentList
private
array<string|int, mixed>
$argumentList
= []
$constraints
private
array<string|int, mixed>
$constraints
= []
$description
private
string
$description
$name
private
string
$name
$permission
private
string|null
$permission
= null
$requiredArgumentCount
private
array<string|int, mixed>
$requiredArgumentCount
= []
Methods
__construct()
public
__construct(string $name[, string $description = "" ][, array<string|int, mixed> $aliases = [] ]) : mixed
Parameters
- $name : string
- $description : string = ""
- $aliases : array<string|int, mixed> = []
Return values
mixed —addConstraint()
public
addConstraint(BaseConstraint $constraint) : void
Parameters
- $constraint : BaseConstraint
Return values
void —generateUsageMessage()
public
generateUsageMessage() : string
Return values
string —getAliases()
public
getAliases() : array<string|int, string>
Return values
array<string|int, string> —getArgumentList()
public
getArgumentList() : array<string|int, array<string|int, BaseArgument>>
Return values
array<string|int, array<string|int, BaseArgument>> —getConstraints()
public
getConstraints() : array<string|int, BaseConstraint>
Return values
array<string|int, BaseConstraint> —getDescription()
public
getDescription() : string
Return values
string —getName()
public
getName() : string
Return values
string —getOwningPlugin()
public
getOwningPlugin() : Plugin
Return values
Plugin —getPermission()
public
getPermission() : string|null
Return values
string|null —getUsageMessage()
public
getUsageMessage() : string
Return values
string —hasArguments()
public
hasArguments() : bool
Return values
bool —hasRequiredArguments()
public
hasRequiredArguments() : bool
Return values
bool —onRun()
public
abstract onRun(CommandSender $sender, string $aliasUsed, array<string|int, mixed> $args) : void
Parameters
- $sender : CommandSender
- $aliasUsed : string
- $args : array<string|int, mixed>
Return values
void —parseArguments()
public
parseArguments(array<string|int, mixed> $rawArgs, CommandSender $sender) : array<string|int, mixed>
Parameters
- $rawArgs : array<string|int, mixed>
- $sender : CommandSender
Return values
array<string|int, mixed> —registerArgument()
public
registerArgument(int $position, BaseArgument $argument) : void
Parameters
- $position : int
- $argument : BaseArgument
Tags
Return values
void —sendError()
public
sendError(int $errorCode[, array<string|int, mixed> $args = [] ]) : void
Parameters
- $errorCode : int
- $args : array<string|int, mixed> = []
Return values
void —sendUsage()
public
sendUsage() : void
Return values
void —setPermission()
public
setPermission(string $permission) : void
Parameters
- $permission : string
Return values
void —testPermissionSilent()
public
testPermissionSilent(CommandSender $sender) : bool
Parameters
- $sender : CommandSender
Return values
bool —prepare()
This is where all the arguments, permissions, sub-commands, etc would be registered
protected
abstract prepare() : void