mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Remove some fully qualified function calls
PhpStorm can't see these or understand how they are being called, which is very annoying for bug hunting. Additionally, we already have the CodeOptimizer for this.
This commit is contained in:
parent
49f80830a7
commit
2d3ce9e8b0
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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){
|
||||
|
@ -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\"");
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user