mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
Merge branch 'stable'
# Conflicts: # composer.lock # resources/vanilla # src/permission/BanEntry.php # src/permission/PermissionAttachmentInfo.php
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;
|
||||
@@ -142,7 +143,9 @@ class BanEntry{
|
||||
private static function parseDate(string $date) : \DateTime{
|
||||
$datetime = \DateTime::createFromFormat(self::$format, $date);
|
||||
if(!($datetime instanceof \DateTime)){
|
||||
throw new \RuntimeException("Corrupted date/time: " . 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("Corrupted date/time: " . implode(", ", $lastErrors["errors"]));
|
||||
}
|
||||
|
||||
return $datetime;
|
||||
|
@@ -36,9 +36,6 @@ class PermissionAttachmentInfo{
|
||||
/** @var bool */
|
||||
private $value;
|
||||
|
||||
/**
|
||||
* @throws \InvalidStateException
|
||||
*/
|
||||
public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){
|
||||
$this->permissible = $permissible;
|
||||
$this->permission = $permission;
|
||||
|
Reference in New Issue
Block a user