diff --git a/tools/compact-regions.php b/tools/compact-regions.php index 62f1d35f4..f1091f101 100644 --- a/tools/compact-regions.php +++ b/tools/compact-regions.php @@ -62,12 +62,12 @@ function find_regions_recursive(string $dir, array &$files) : void{ return; } foreach($dirFiles as $file){ - if($file === "." or $file === ".."){ + if($file === "." || $file === ".."){ continue; } $fullPath = $dir . "/" . $file; if( - in_array(pathinfo($fullPath, PATHINFO_EXTENSION), SUPPORTED_EXTENSIONS, true) and + in_array(pathinfo($fullPath, PATHINFO_EXTENSION), SUPPORTED_EXTENSIONS, true) && is_file($fullPath) ){ $files[$fullPath] = filesize($fullPath); diff --git a/tools/convert-world.php b/tools/convert-world.php index 7d83d5fd8..bbe2ee9a7 100644 --- a/tools/convert-world.php +++ b/tools/convert-world.php @@ -59,7 +59,7 @@ if($inputPath === false){ exit(1); } $backupPath = realpath($args["backup"]); -if($backupPath === false || (!@mkdir($backupPath, 0777, true) and !is_dir($backupPath)) or !is_writable($backupPath)){ +if($backupPath === false || (!@mkdir($backupPath, 0777, true) && !is_dir($backupPath)) || !is_writable($backupPath)){ fwrite(STDERR, "Backup file path " . $args["backup"] . " is not writable (permission error or doesn't exist), aborting" . PHP_EOL); exit(1); } diff --git a/tools/ping-server.php b/tools/ping-server.php index ad2bd59ef..ae6f896c2 100644 --- a/tools/ping-server.php +++ b/tools/ping-server.php @@ -88,7 +88,7 @@ function ping_server(\Socket $socket, string $serverIp, int $serverPort, int $ti \GlobalLogger::get()->error("Error reading from socket: " . socket_strerror(socket_last_error($socket))); return false; } - if($recvAddr === $serverIp and $recvPort === $serverPort and $recvBuffer !== "" and ord($recvBuffer[0]) === MessageIdentifiers::ID_UNCONNECTED_PONG){ + if($recvAddr === $serverIp && $recvPort === $serverPort && $recvBuffer !== "" && ord($recvBuffer[0]) === MessageIdentifiers::ID_UNCONNECTED_PONG){ $pong = new UnconnectedPong(); $pong->decode(new PacketSerializer($recvBuffer)); \GlobalLogger::get()->info("--- Response received ---");