Rename CommandReader and friends to ConsoleReader

This commit is contained in:
Dylan K. Taylor 2021-06-26 19:29:58 +01:00
parent a70bd115f1
commit e14bad4ea6
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
6 changed files with 11 additions and 11 deletions

View File

@ -30,7 +30,7 @@ namespace pocketmine;
use pocketmine\command\Command; use pocketmine\command\Command;
use pocketmine\command\CommandSender; use pocketmine\command\CommandSender;
use pocketmine\command\SimpleCommandMap; use pocketmine\command\SimpleCommandMap;
use pocketmine\console\CommandReaderThread; use pocketmine\console\ConsoleReaderThread;
use pocketmine\console\ConsoleCommandSender; use pocketmine\console\ConsoleCommandSender;
use pocketmine\crafting\CraftingManager; use pocketmine\crafting\CraftingManager;
use pocketmine\crafting\CraftingManagerFromDataHelper; use pocketmine\crafting\CraftingManagerFromDataHelper;
@ -227,7 +227,7 @@ class Server{
/** @var MemoryManager */ /** @var MemoryManager */
private $memoryManager; private $memoryManager;
/** @var CommandReaderThread */ /** @var ConsoleReaderThread */
private $console; private $console;
/** @var SimpleCommandMap */ /** @var SimpleCommandMap */
@ -1130,7 +1130,7 @@ class Server{
$consoleNotifier = new SleeperNotifier(); $consoleNotifier = new SleeperNotifier();
$commandBuffer = new \Threaded(); $commandBuffer = new \Threaded();
$this->console = new CommandReaderThread($commandBuffer, $consoleNotifier); $this->console = new ConsoleReaderThread($commandBuffer, $consoleNotifier);
$this->tickSleeper->addNotifier($consoleNotifier, function() use ($commandBuffer, $consoleSender) : void{ $this->tickSleeper->addNotifier($consoleNotifier, function() use ($commandBuffer, $consoleSender) : void{
Timings::$serverCommand->startTiming(); Timings::$serverCommand->startTiming();
while(($line = $commandBuffer->shift()) !== null){ while(($line = $commandBuffer->shift()) !== null){
@ -1419,7 +1419,7 @@ class Server{
$this->configGroup->save(); $this->configGroup->save();
} }
if($this->console instanceof CommandReaderThread){ if($this->console instanceof ConsoleReaderThread){
$this->getLogger()->debug("Closing console"); $this->getLogger()->debug("Closing console");
$this->console->shutdown(); $this->console->shutdown();
$this->console->notify(); $this->console->notify();

View File

@ -31,7 +31,7 @@ use function stream_select;
use function trim; use function trim;
use function usleep; use function usleep;
final class CommandReader{ final class ConsoleReader{
/** @var resource */ /** @var resource */
private $stdin; private $stdin;

View File

@ -30,7 +30,7 @@ use function microtime;
use function preg_replace; use function preg_replace;
use function usleep; use function usleep;
final class CommandReaderThread extends Thread{ final class ConsoleReaderThread extends Thread{
private \Threaded $buffer; private \Threaded $buffer;
private ?SleeperNotifier $notifier; private ?SleeperNotifier $notifier;
@ -63,7 +63,7 @@ final class CommandReaderThread extends Thread{
$buffer = $this->buffer; $buffer = $this->buffer;
$notifier = $this->notifier; $notifier = $this->notifier;
$reader = new CommandReader(); $reader = new ConsoleReader();
while(!$this->shutdown){ while(!$this->shutdown){
$line = $reader->readLine(); $line = $reader->readLine();

View File

@ -6,7 +6,7 @@ parameters:
path: ../../../src/CrashDump.php path: ../../../src/CrashDump.php
- -
message: "#^Instanceof between pocketmine\\\\console\\\\CommandReaderThread and pocketmine\\\\console\\\\CommandReaderThread will always evaluate to true\\.$#" message: "#^Instanceof between pocketmine\\\\console\\\\ConsoleReaderThread and pocketmine\\\\console\\\\ConsoleReaderThread will always evaluate to true\\.$#"
count: 1 count: 1
path: ../../../src/Server.php path: ../../../src/Server.php

View File

@ -436,9 +436,9 @@ parameters:
path: ../../../src/block/tile/TileFactory.php path: ../../../src/block/tile/TileFactory.php
- -
message: "#^Property pocketmine\\\\console\\\\CommandReader\\:\\:\\$stdin \\(resource\\) does not accept resource\\|false\\.$#" message: "#^Property pocketmine\\\\console\\\\ConsoleReader\\:\\:\\$stdin \\(resource\\) does not accept resource\\|false\\.$#"
count: 1 count: 1
path: ../../../src/console/CommandReader.php path: ../../../src/console/ConsoleReader.php
- -
message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#" message: "#^Only booleans are allowed in an if condition, int\\|false given\\.$#"

View File

@ -3,7 +3,7 @@ parameters:
- -
message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#" message: "#^Call to function is_resource\\(\\) with resource will always evaluate to true\\.$#"
count: 2 count: 2
path: ../../../src/console/CommandReader.php path: ../../../src/console/ConsoleReader.php
- -
message: "#^Method pocketmine\\\\crafting\\\\CraftingManager\\:\\:getDestructorCallbacks\\(\\) should return pocketmine\\\\utils\\\\ObjectSet\\<Closure\\(\\)\\: void\\> but returns pocketmine\\\\utils\\\\ObjectSet\\<Closure\\(\\)\\: void\\>\\|pocketmine\\\\utils\\\\ObjectSet\\<object\\>\\.$#" message: "#^Method pocketmine\\\\crafting\\\\CraftingManager\\:\\:getDestructorCallbacks\\(\\) should return pocketmine\\\\utils\\\\ObjectSet\\<Closure\\(\\)\\: void\\> but returns pocketmine\\\\utils\\\\ObjectSet\\<Closure\\(\\)\\: void\\>\\|pocketmine\\\\utils\\\\ObjectSet\\<object\\>\\.$#"