From 1eae133118ac9e36f031a71b9d59593deceec13a Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 21 Jan 2022 23:39:37 +0000 Subject: [PATCH] fixed PHPStan build --- phpstan.neon.dist | 1 + tests/phpstan/configs/actual-problems.neon | 10 ++++++++++ tests/phpstan/stubs/phpasn1.stub | 22 ++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 tests/phpstan/stubs/phpasn1.stub diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 8ad20ab63..dcb2292c3 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -39,6 +39,7 @@ parameters: stubFiles: - tests/phpstan/stubs/chunkutils.stub - tests/phpstan/stubs/leveldb.stub + - tests/phpstan/stubs/phpasn1.stub - tests/phpstan/stubs/pthreads.stub reportUnmatchedIgnoredErrors: false #no other way to silence platform-specific non-warnings staticReflectionClassNamePatterns: diff --git a/tests/phpstan/configs/actual-problems.neon b/tests/phpstan/configs/actual-problems.neon index 7ee1e46ed..3c3c68ec2 100644 --- a/tests/phpstan/configs/actual-problems.neon +++ b/tests/phpstan/configs/actual-problems.neon @@ -3410,6 +3410,16 @@ parameters: count: 1 path: ../../../src/pocketmine/network/mcpe/convert/RuntimeBlockMapping.php + - + message: "#^Method pocketmine\\\\network\\\\mcpe\\\\encryption\\\\EncryptionUtils\\:\\:generateKey\\(\\) should return string but returns string\\|false\\.$#" + count: 1 + path: ../../../src/pocketmine/network/mcpe/encryption/EncryptionUtils.php + + - + message: "#^Property pocketmine\\\\network\\\\mcpe\\\\encryption\\\\PrepareEncryptionTask\\:\\:\\$serverPrivateKey \\(string\\) does not accept string\\|null\\.$#" + count: 1 + path: ../../../src/pocketmine/network/mcpe/encryption/PrepareEncryptionTask.php + - message: "#^Property pocketmine\\\\network\\\\mcpe\\\\protocol\\\\AddActorPacket\\:\\:\\$metadata \\(array\\\\) does not accept array\\\\.$#" count: 1 diff --git a/tests/phpstan/stubs/phpasn1.stub b/tests/phpstan/stubs/phpasn1.stub new file mode 100644 index 000000000..b459289ef --- /dev/null +++ b/tests/phpstan/stubs/phpasn1.stub @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace FG\ASN1\Universal; + +class Integer +{ + /** + * @param int|string $value + */ + public function __construct($value){} + + /** @return int|string */ + public function getContent(){} +}