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{
/** @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;

View File

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

View File

@ -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);

View File

@ -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();
}