Modernize property declarations in pocketmine\command namespace

This commit is contained in:
Dylan K. Taylor 2022-04-25 13:09:14 +01:00
parent 72cff0ee11
commit dca457b1e0
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
4 changed files with 11 additions and 24 deletions

View File

@ -40,23 +40,18 @@ use function str_replace;
abstract class Command{ abstract class Command{
/** @var string */ private string $name;
private $name;
/** @var string */ private string $nextLabel;
private $nextLabel; private string $label;
/** @var string */
private $label;
/** @var string[] */ /** @var string[] */
private $aliases = []; private array $aliases = [];
/** @var string[] */ /** @var string[] */
private $activeAliases = []; private array $activeAliases = [];
/** @var CommandMap|null */ private ?CommandMap $commandMap = null;
private $commandMap = null;
/** @var Translatable|string */ /** @var Translatable|string */
protected $description = ""; protected $description = "";
@ -64,11 +59,8 @@ abstract class Command{
/** @var Translatable|string */ /** @var Translatable|string */
protected $usageMessage; protected $usageMessage;
/** @var string|null */ private ?string $permission = null;
private $permission = null; private ?string $permissionMessage = null;
/** @var string|null */
private $permissionMessage = null;
/** @var TimingsHandler|null */ /** @var TimingsHandler|null */
public $timings = null; public $timings = null;

View File

@ -33,7 +33,7 @@ use function substr;
class FormattedCommandAlias extends Command{ class FormattedCommandAlias extends Command{
/** @var string[] */ /** @var string[] */
private $formatStrings = []; private array $formatStrings = [];
/** /**
* @param string[] $formatStrings * @param string[] $formatStrings

View File

@ -31,8 +31,7 @@ use pocketmine\plugin\PluginOwnedTrait;
final class PluginCommand extends Command implements PluginOwned{ final class PluginCommand extends Command implements PluginOwned{
use PluginOwnedTrait; use PluginOwnedTrait;
/** @var CommandExecutor */ private CommandExecutor $executor;
private $executor;
public function __construct(string $name, Plugin $owner, CommandExecutor $executor){ public function __construct(string $name, Plugin $owner, CommandExecutor $executor){
parent::__construct($name); parent::__construct($name);

View File

@ -84,11 +84,7 @@ class SimpleCommandMap implements CommandMap{
/** @var Command[] */ /** @var Command[] */
protected $knownCommands = []; protected $knownCommands = [];
/** @var Server */ public function __construct(private Server $server){
private $server;
public function __construct(Server $server){
$this->server = $server;
$this->setDefaultCommands(); $this->setDefaultCommands();
} }