Merge branch 'stable'

# Conflicts:
#	composer.lock
#	resources/vanilla
#	src/permission/BanEntry.php
#	src/permission/PermissionAttachmentInfo.php
This commit is contained in:
Dylan K. Taylor 2020-12-01 17:35:30 +00:00
commit d48af3f4ca
5 changed files with 42 additions and 38 deletions

View File

@ -51,7 +51,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"

64
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": "0c3e5c9b592778a5c4421bde7dd12d4a",
"content-hash": "265c9d2e9b1ec4d52c934b4bec7a9188",
"packages": [
{
"name": "adhocore/json-comment",
@ -1242,16 +1242,16 @@
},
{
"name": "phar-io/version",
"version": "3.0.2",
"version": "3.0.3",
"source": {
"type": "git",
"url": "https://github.com/phar-io/version.git",
"reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0"
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0",
"reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0",
"url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"shasum": ""
},
"require": {
@ -1287,9 +1287,9 @@
"description": "Library for handling version information and constraints",
"support": {
"issues": "https://github.com/phar-io/version/issues",
"source": "https://github.com/phar-io/version/tree/master"
"source": "https://github.com/phar-io/version/tree/3.0.3"
},
"time": "2020-06-27T14:39:04+00:00"
"time": "2020-11-30T09:21:21+00:00"
},
{
"name": "phpdocumentor/reflection-common",
@ -1518,16 +1518,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": {
@ -1558,7 +1558,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": [
{
@ -1574,7 +1574,7 @@
"type": "tidelift"
}
],
"time": "2020-11-21T12:53:28+00:00"
"time": "2020-11-29T13:32:03+00:00"
},
{
"name": "phpstan/phpstan-phpunit",
@ -1693,16 +1693,16 @@
},
{
"name": "phpunit/php-code-coverage",
"version": "9.2.3",
"version": "9.2.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41"
"reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b20e2055f7c29b56cb3870b3de7cc463d7add41",
"reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
"reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
"shasum": ""
},
"require": {
@ -1716,7 +1716,7 @@
"sebastian/code-unit-reverse-lookup": "^2.0.2",
"sebastian/complexity": "^2.0",
"sebastian/environment": "^5.1.2",
"sebastian/lines-of-code": "^1.0",
"sebastian/lines-of-code": "^1.0.3",
"sebastian/version": "^3.0.1",
"theseer/tokenizer": "^1.2.0"
},
@ -1758,7 +1758,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.3"
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.5"
},
"funding": [
{
@ -1766,7 +1766,7 @@
"type": "github"
}
],
"time": "2020-10-30T10:46:41+00:00"
"time": "2020-11-28T06:44:49+00:00"
},
{
"name": "phpunit/php-file-iterator",
@ -2011,16 +2011,16 @@
},
{
"name": "phpunit/phpunit",
"version": "9.4.3",
"version": "9.4.4",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab"
"reference": "6535e637961f0829832621dc1b7308c2d24a799e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab",
"reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6535e637961f0829832621dc1b7308c2d24a799e",
"reference": "6535e637961f0829832621dc1b7308c2d24a799e",
"shasum": ""
},
"require": {
@ -2098,7 +2098,7 @@
],
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.3"
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.4"
},
"funding": [
{
@ -2110,7 +2110,7 @@
"type": "github"
}
],
"time": "2020-11-10T12:53:30+00:00"
"time": "2020-12-01T04:58:47+00:00"
},
{
"name": "sebastian/cli-parser",
@ -2682,16 +2682,16 @@
},
{
"name": "sebastian/lines-of-code",
"version": "1.0.2",
"version": "1.0.3",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git",
"reference": "acf76492a65401babcf5283296fa510782783a7a"
"reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/acf76492a65401babcf5283296fa510782783a7a",
"reference": "acf76492a65401babcf5283296fa510782783a7a",
"url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
"reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
"shasum": ""
},
"require": {
@ -2727,7 +2727,7 @@
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
"support": {
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
"source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.2"
"source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
},
"funding": [
{
@ -2735,7 +2735,7 @@
"type": "github"
}
],
"time": "2020-10-26T17:03:56+00:00"
"time": "2020-11-28T06:42:11+00:00"
},
{
"name": "sebastian/object-enumerator",

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

View File

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

View File

@ -159,7 +159,11 @@ class PluginDescription{
$this->authors = [];
if(isset($plugin["author"])){
$this->authors[] = $plugin["author"];
if(is_array($plugin["author"])){
$this->authors = $plugin["author"];
}else{
$this->authors[] = $plugin["author"];
}
}
if(isset($plugin["authors"])){
foreach($plugin["authors"] as $author){