diff --git a/src/pocketmine/command/CommandMap.php b/src/pocketmine/command/CommandMap.php index 6b946a6aa..b48ecb815 100644 --- a/src/pocketmine/command/CommandMap.php +++ b/src/pocketmine/command/CommandMap.php @@ -37,9 +37,9 @@ interface CommandMap{ * @param Command $command * @param string|null $label * - * @return + * @return bool */ - public function register(string $fallbackPrefix, Command $command, string $label = null); + public function register(string $fallbackPrefix, Command $command, string $label = null) : bool; /** * @param CommandSender $sender diff --git a/src/pocketmine/command/SimpleCommandMap.php b/src/pocketmine/command/SimpleCommandMap.php index 2fef70b6a..6e908c444 100644 --- a/src/pocketmine/command/SimpleCommandMap.php +++ b/src/pocketmine/command/SimpleCommandMap.php @@ -137,7 +137,14 @@ class SimpleCommandMap implements CommandMap{ } } - public function register(string $fallbackPrefix, Command $command, string $label = null){ + /** + * @param string $fallbackPrefix + * @param Command $command + * @param string|null $label + * + * @return bool + */ + public function register(string $fallbackPrefix, Command $command, string $label = null) : bool{ if($label === null){ $label = $command->getName(); } @@ -163,7 +170,15 @@ class SimpleCommandMap implements CommandMap{ return $registered; } - private function registerAlias(Command $command, $isAlias, $fallbackPrefix, $label){ + /** + * @param Command $command + * @param bool $isAlias + * @param string $fallbackPrefix + * @param string $label + * + * @return bool + */ + private function registerAlias(Command $command, bool $isAlias, string $fallbackPrefix, string $label) : bool{ $this->knownCommands[$fallbackPrefix . ":" . $label] = $command; if(($command instanceof VanillaCommand or $isAlias) and isset($this->knownCommands[$label])){ return false;