From 7a1b5c5a2d26f7131fb549aa25507b390714e130 Mon Sep 17 00:00:00 2001 From: matcracker Date: Sat, 20 Jul 2019 14:56:07 +0200 Subject: [PATCH] Updated docs --- src/matcracker/BedcoreProtect/commands/CommandParser.php | 3 --- src/matcracker/BedcoreProtect/storage/Database.php | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/matcracker/BedcoreProtect/commands/CommandParser.php b/src/matcracker/BedcoreProtect/commands/CommandParser.php index 2d85c398..ceb5b96b 100644 --- a/src/matcracker/BedcoreProtect/commands/CommandParser.php +++ b/src/matcracker/BedcoreProtect/commands/CommandParser.php @@ -30,7 +30,6 @@ use pocketmine\item\ItemFactory; use pocketmine\math\Vector3; use pocketmine\Server; -use UnexpectedValueException; CommandParser::initActions(); @@ -230,7 +229,6 @@ public function parse(): bool * @param bool $restore * * @return string - * @throws UnexpectedValueException if it is used before CommandParser::parse() */ public function buildBlocksLogSelectionQuery(Vector3 $vector3, bool $restore = false): string { @@ -410,7 +408,6 @@ public function buildEntitiesLogSelectionQuery(Vector3 $vector3, bool $restore = * It returns an array with the parsed data from the command. * * @return array - * @throws UnexpectedValueException if it is used before CommandParser::parse() */ public function getAllData(): array { diff --git a/src/matcracker/BedcoreProtect/storage/Database.php b/src/matcracker/BedcoreProtect/storage/Database.php index 03efdb27..62dc15ad 100644 --- a/src/matcracker/BedcoreProtect/storage/Database.php +++ b/src/matcracker/BedcoreProtect/storage/Database.php @@ -40,6 +40,10 @@ public function __construct(Main $plugin) $this->plugin = $plugin; } + /** + * Attempts to connect to the database. Returns true if success. + * @return bool + */ public final function connect(): bool { try { @@ -60,6 +64,7 @@ public final function connect(): bool public final function getQueries(): Queries { if (!$this->isConnected()) { + $this->plugin->getLogger()->critical("Could not connect to the database! Check your connection, database settings or plugin configuration file"); $this->plugin->getServer()->getPluginManager()->disablePlugin($this->plugin); }