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" "composer-runtime-api": "^2.0"
}, },
"require-dev": { "require-dev": {
"phpstan/phpstan": "0.12.57", "phpstan/phpstan": "0.12.58",
"phpstan/phpstan-phpunit": "^0.12.6", "phpstan/phpstan-phpunit": "^0.12.6",
"phpstan/phpstan-strict-rules": "^0.12.2", "phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^9.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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0c3e5c9b592778a5c4421bde7dd12d4a", "content-hash": "265c9d2e9b1ec4d52c934b4bec7a9188",
"packages": [ "packages": [
{ {
"name": "adhocore/json-comment", "name": "adhocore/json-comment",
@ -1242,16 +1242,16 @@
}, },
{ {
"name": "phar-io/version", "name": "phar-io/version",
"version": "3.0.2", "version": "3.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phar-io/version.git", "url": "https://github.com/phar-io/version.git",
"reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0" "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phar-io/version/zipball/c6bb6825def89e0a32220f88337f8ceaf1975fa0", "url": "https://api.github.com/repos/phar-io/version/zipball/726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"reference": "c6bb6825def89e0a32220f88337f8ceaf1975fa0", "reference": "726c026815142e4f8677b7cb7f2249c9ffb7ecae",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1287,9 +1287,9 @@
"description": "Library for handling version information and constraints", "description": "Library for handling version information and constraints",
"support": { "support": {
"issues": "https://github.com/phar-io/version/issues", "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", "name": "phpdocumentor/reflection-common",
@ -1518,16 +1518,16 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "0.12.57", "version": "0.12.58",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpstan.git", "url": "https://github.com/phpstan/phpstan.git",
"reference": "f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b" "reference": "2a4847df6047b30af28854ed9dc95304cdb56ae5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2a4847df6047b30af28854ed9dc95304cdb56ae5",
"reference": "f9909d1d0c44b4cbaf72babcf80e8f14d6fdd55b", "reference": "2a4847df6047b30af28854ed9dc95304cdb56ae5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1558,7 +1558,7 @@
"description": "PHPStan - PHP Static Analysis Tool", "description": "PHPStan - PHP Static Analysis Tool",
"support": { "support": {
"issues": "https://github.com/phpstan/phpstan/issues", "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": [ "funding": [
{ {
@ -1574,7 +1574,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2020-11-21T12:53:28+00:00" "time": "2020-11-29T13:32:03+00:00"
}, },
{ {
"name": "phpstan/phpstan-phpunit", "name": "phpstan/phpstan-phpunit",
@ -1693,16 +1693,16 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "9.2.3", "version": "9.2.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41" "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b20e2055f7c29b56cb3870b3de7cc463d7add41", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f3e026641cc91909d421802dd3ac7827ebfd97e1",
"reference": "6b20e2055f7c29b56cb3870b3de7cc463d7add41", "reference": "f3e026641cc91909d421802dd3ac7827ebfd97e1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1716,7 +1716,7 @@
"sebastian/code-unit-reverse-lookup": "^2.0.2", "sebastian/code-unit-reverse-lookup": "^2.0.2",
"sebastian/complexity": "^2.0", "sebastian/complexity": "^2.0",
"sebastian/environment": "^5.1.2", "sebastian/environment": "^5.1.2",
"sebastian/lines-of-code": "^1.0", "sebastian/lines-of-code": "^1.0.3",
"sebastian/version": "^3.0.1", "sebastian/version": "^3.0.1",
"theseer/tokenizer": "^1.2.0" "theseer/tokenizer": "^1.2.0"
}, },
@ -1758,7 +1758,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "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": [ "funding": [
{ {
@ -1766,7 +1766,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-10-30T10:46:41+00:00" "time": "2020-11-28T06:44:49+00:00"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@ -2011,16 +2011,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.4.3", "version": "9.4.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab" "reference": "6535e637961f0829832621dc1b7308c2d24a799e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6535e637961f0829832621dc1b7308c2d24a799e",
"reference": "9fa359ff5ddaa5eb2be2bedb08a6a5787a5807ab", "reference": "6535e637961f0829832621dc1b7308c2d24a799e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2098,7 +2098,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "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": [ "funding": [
{ {
@ -2110,7 +2110,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-11-10T12:53:30+00:00" "time": "2020-12-01T04:58:47+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -2682,16 +2682,16 @@
}, },
{ {
"name": "sebastian/lines-of-code", "name": "sebastian/lines-of-code",
"version": "1.0.2", "version": "1.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/lines-of-code.git", "url": "https://github.com/sebastianbergmann/lines-of-code.git",
"reference": "acf76492a65401babcf5283296fa510782783a7a" "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/acf76492a65401babcf5283296fa510782783a7a", "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
"reference": "acf76492a65401babcf5283296fa510782783a7a", "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -2727,7 +2727,7 @@
"homepage": "https://github.com/sebastianbergmann/lines-of-code", "homepage": "https://github.com/sebastianbergmann/lines-of-code",
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "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": [ "funding": [
{ {
@ -2735,7 +2735,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-10-26T17:03:56+00:00" "time": "2020-11-28T06:42:11+00:00"
}, },
{ {
"name": "sebastian/object-enumerator", "name": "sebastian/object-enumerator",

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\permission; namespace pocketmine\permission;
use pocketmine\utils\AssumptionFailedError;
use function array_shift; use function array_shift;
use function count; use function count;
use function explode; use function explode;
@ -142,7 +143,9 @@ class BanEntry{
private static function parseDate(string $date) : \DateTime{ private static function parseDate(string $date) : \DateTime{
$datetime = \DateTime::createFromFormat(self::$format, $date); $datetime = \DateTime::createFromFormat(self::$format, $date);
if(!($datetime instanceof \DateTime)){ 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; return $datetime;

View File

@ -36,9 +36,6 @@ class PermissionAttachmentInfo{
/** @var bool */ /** @var bool */
private $value; private $value;
/**
* @throws \InvalidStateException
*/
public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){ public function __construct(Permissible $permissible, string $permission, ?PermissionAttachment $attachment, bool $value){
$this->permissible = $permissible; $this->permissible = $permissible;
$this->permission = $permission; $this->permission = $permission;

View File

@ -159,7 +159,11 @@ class PluginDescription{
$this->authors = []; $this->authors = [];
if(isset($plugin["author"])){ 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"])){ if(isset($plugin["authors"])){
foreach($plugin["authors"] as $author){ foreach($plugin["authors"] as $author){