phpstan 0.12.58

This commit is contained in:
Dylan K. Taylor 2020-11-30 22:11:43 +00:00
parent 3709ba172b
commit 215bac8dd7
3 changed files with 12 additions and 9 deletions

View File

@ -38,7 +38,7 @@
"composer-runtime-api": "^2.0"
},
"require-dev": {
"phpstan/phpstan": "0.12.57",
"phpstan/phpstan": "0.12.58",
"phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.2"

14
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "da01dc4097df12e4b124207d071b81f4",
"content-hash": "6e254dbfde069aa358d41f88a9ea7f1e",
"packages": [
{
"name": "adhocore/json-comment",
@ -996,16 +996,16 @@
},
{
"name": "phpstan/phpstan",
"version": "0.12.57",
"version": "0.12.58",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b"
"reference": "2a4847df6047b30af28854ed9dc95304cdb56ae5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b",
"reference": "f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/2a4847df6047b30af28854ed9dc95304cdb56ae5",
"reference": "2a4847df6047b30af28854ed9dc95304cdb56ae5",
"shasum": ""
},
"require": {
@ -1036,7 +1036,7 @@
"description": "PHPStan - PHP Static Analysis Tool",
"support": {
"issues": "https://github.com/phpstan/phpstan/issues",
"source": "https://github.com/phpstan/phpstan/tree/0.12.57"
"source": "https://github.com/phpstan/phpstan/tree/0.12.58"
},
"funding": [
{
@ -1052,7 +1052,7 @@
"type": "tidelift"
}
],
"time": "2020-11-21T12:53:28+00:00"
"time": "2020-11-29T13:32:03+00:00"
},
{
"name": "phpstan/phpstan-phpunit",

View File

@ -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;