diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index e8ce1cc83..c245fa2b2 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -686,7 +686,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ $aliases = $command->getAliases(); if(!empty($aliases)){ - if(!\in_array($data->commandName, $aliases, true)){ + if(!in_array($data->commandName, $aliases, true)){ //work around a client bug which makes the original name not show when aliases are used $aliases[] = $data->commandName; } diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index ec11fa1ea..cc353b1c0 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -171,8 +171,8 @@ namespace pocketmine { $opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-profiler"]); - define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : \realpath(\getcwd()) . DIRECTORY_SEPARATOR); - define('pocketmine\PLUGIN_PATH', isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : \realpath(\getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR); + define('pocketmine\DATA', isset($opts["data"]) ? $opts["data"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR); + define('pocketmine\PLUGIN_PATH', isset($opts["plugins"]) ? $opts["plugins"] . DIRECTORY_SEPARATOR : realpath(getcwd()) . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR); if(!file_exists(\pocketmine\DATA)){ mkdir(\pocketmine\DATA, 0777, true); diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 7256e7078..94b4305f1 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -2162,7 +2162,7 @@ class Server{ $this->logger->logException($e, $trace); $lastError = [ - "type" => \get_class($e), + "type" => get_class($e), "message" => $errstr, "fullFile" => $e->getFile(), "file" => $errfile, diff --git a/src/pocketmine/entity/Effect.php b/src/pocketmine/entity/Effect.php index df8a8ddb2..9edc3b55d 100644 --- a/src/pocketmine/entity/Effect.php +++ b/src/pocketmine/entity/Effect.php @@ -111,8 +111,8 @@ class Effect{ */ public static function getEffectByName(string $name) : ?Effect{ $const = self::class . "::" . strtoupper($name); - if(\defined($const)){ - return self::getEffect(\constant($const)); + if(defined($const)){ + return self::getEffect(constant($const)); } return null; } diff --git a/src/pocketmine/entity/projectile/Projectile.php b/src/pocketmine/entity/projectile/Projectile.php index e88e0cc6d..7cd579690 100644 --- a/src/pocketmine/entity/projectile/Projectile.php +++ b/src/pocketmine/entity/projectile/Projectile.php @@ -215,7 +215,7 @@ abstract class Projectile extends Entity{ }elseif($blockHit !== null){ $ev = new ProjectileHitBlockEvent($this, $hitResult, $blockHit); }else{ - \assert(false, "unknown hit type"); + assert(false, "unknown hit type"); } if($ev !== null){ diff --git a/src/pocketmine/event/EventPriority.php b/src/pocketmine/event/EventPriority.php index 1fffbbcd1..0de4e1e4f 100644 --- a/src/pocketmine/event/EventPriority.php +++ b/src/pocketmine/event/EventPriority.php @@ -82,8 +82,8 @@ abstract class EventPriority{ public static function fromString(string $name) : int{ $name = strtoupper($name); $const = self::class . "::" . $name; - if($name !== "ALL" and \defined($const)){ - return \constant($const); + if($name !== "ALL" and defined($const)){ + return constant($const); } throw new \InvalidArgumentException("Unable to resolve priority \"$name\""); diff --git a/src/pocketmine/plugin/PluginDescription.php b/src/pocketmine/plugin/PluginDescription.php index a126cbd6b..fc20ed2b2 100644 --- a/src/pocketmine/plugin/PluginDescription.php +++ b/src/pocketmine/plugin/PluginDescription.php @@ -59,7 +59,7 @@ class PluginDescription{ * @param string|array $yamlString */ public function __construct($yamlString){ - $this->loadMap(!is_array($yamlString) ? \yaml_parse($yamlString) : $yamlString); + $this->loadMap(!is_array($yamlString) ? yaml_parse($yamlString) : $yamlString); } /** diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index 134ffd976..861ea2e1a 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -796,7 +796,7 @@ class PluginManager{ try{ $priority = isset($tags["priority"]) ? EventPriority::fromString($tags["priority"]) : EventPriority::NORMAL; }catch(\InvalidArgumentException $e){ - throw new PluginException("Event handler " . \get_class($listener) . "->" . $method->getName() . "() declares invalid/unknown priority \"" . $tags["priority"] . "\""); + throw new PluginException("Event handler " . get_class($listener) . "->" . $method->getName() . "() declares invalid/unknown priority \"" . $tags["priority"] . "\""); } $ignoreCancelled = isset($tags["ignoreCancelled"]) && strtolower($tags["ignoreCancelled"]) === "true";