Stop hardcoding permission names everywhere

using strings for permission names is nearly as shitty, but this is at least cross-referencable and statically analysable.
This commit is contained in:
Dylan K. Taylor
2021-06-26 19:14:51 +01:00
parent 0910054c41
commit bf7d69b69e
43 changed files with 267 additions and 115 deletions

View File

@@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\command\defaults;
use pocketmine\command\CommandSender;
use pocketmine\permission\DefaultPermissionNames;
use function date;
class DumpMemoryCommand extends VanillaCommand{
@@ -34,7 +35,7 @@ class DumpMemoryCommand extends VanillaCommand{
"Dumps the memory",
"/$name [path]"
);
$this->setPermission("pocketmine.command.dumpmemory");
$this->setPermission(DefaultPermissionNames::COMMAND_DUMPMEMORY);
}
public function execute(CommandSender $sender, string $commandLabel, array $args){