mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
phpstan 0.12.58
This commit is contained in:
@ -23,6 +23,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\permission;
|
||||
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use function array_shift;
|
||||
use function count;
|
||||
use function explode;
|
||||
@ -145,7 +146,9 @@ class BanEntry{
|
||||
private static function parseDate(string $date) : \DateTime{
|
||||
$datetime = \DateTime::createFromFormat(self::$format, $date);
|
||||
if(!($datetime instanceof \DateTime)){
|
||||
throw new \RuntimeException("Error parsing date for BanEntry: " . implode(", ", \DateTime::getLastErrors()["errors"]));
|
||||
$lastErrors = \DateTime::getLastErrors();
|
||||
if($lastErrors === false) throw new AssumptionFailedError("DateTime::getLastErrors() should not be returning false in here");
|
||||
throw new \RuntimeException("Error parsing date for BanEntry: " . implode(", ", $lastErrors["errors"]));
|
||||
}
|
||||
|
||||
return $datetime;
|
||||
|
Reference in New Issue
Block a user