diff --git a/src/command/Command.php b/src/command/Command.php index 6b1d6ab33..51e3ef51c 100644 --- a/src/command/Command.php +++ b/src/command/Command.php @@ -40,23 +40,18 @@ use function str_replace; abstract class Command{ - /** @var string */ - private $name; + private string $name; - /** @var string */ - private $nextLabel; - - /** @var string */ - private $label; + private string $nextLabel; + private string $label; /** @var string[] */ - private $aliases = []; + private array $aliases = []; /** @var string[] */ - private $activeAliases = []; + private array $activeAliases = []; - /** @var CommandMap|null */ - private $commandMap = null; + private ?CommandMap $commandMap = null; /** @var Translatable|string */ protected $description = ""; @@ -64,11 +59,8 @@ abstract class Command{ /** @var Translatable|string */ protected $usageMessage; - /** @var string|null */ - private $permission = null; - - /** @var string|null */ - private $permissionMessage = null; + private ?string $permission = null; + private ?string $permissionMessage = null; /** @var TimingsHandler|null */ public $timings = null; diff --git a/src/command/FormattedCommandAlias.php b/src/command/FormattedCommandAlias.php index 968c10012..ca8908897 100644 --- a/src/command/FormattedCommandAlias.php +++ b/src/command/FormattedCommandAlias.php @@ -33,7 +33,7 @@ use function substr; class FormattedCommandAlias extends Command{ /** @var string[] */ - private $formatStrings = []; + private array $formatStrings = []; /** * @param string[] $formatStrings diff --git a/src/command/PluginCommand.php b/src/command/PluginCommand.php index 634978006..73e27a0f8 100644 --- a/src/command/PluginCommand.php +++ b/src/command/PluginCommand.php @@ -31,8 +31,7 @@ use pocketmine\plugin\PluginOwnedTrait; final class PluginCommand extends Command implements PluginOwned{ use PluginOwnedTrait; - /** @var CommandExecutor */ - private $executor; + private CommandExecutor $executor; public function __construct(string $name, Plugin $owner, CommandExecutor $executor){ parent::__construct($name); diff --git a/src/command/SimpleCommandMap.php b/src/command/SimpleCommandMap.php index 116f59c23..13d27c06f 100644 --- a/src/command/SimpleCommandMap.php +++ b/src/command/SimpleCommandMap.php @@ -84,11 +84,7 @@ class SimpleCommandMap implements CommandMap{ /** @var Command[] */ protected $knownCommands = []; - /** @var Server */ - private $server; - - public function __construct(Server $server){ - $this->server = $server; + public function __construct(private Server $server){ $this->setDefaultCommands(); }