diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 177ba8f6d..35851d6f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,10 +38,10 @@ jobs: matrix: include: - php: 8.0.7 - config: phpstan.php8.neon + config: phpstan.neon.dist image: ubuntu-20.04 - php: 7.4.20 - config: phpstan.neon.dist + config: phpstan.php7.neon image: ubuntu-20.04 steps: diff --git a/phpstan.neon.dist b/phpstan.neon.dist index cd3c5b18b..7e347bcee 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -5,6 +5,7 @@ includes: - tests/phpstan/configs/impossible-generics.neon - tests/phpstan/configs/l7-baseline.neon - tests/phpstan/configs/l8-baseline.neon + - tests/phpstan/configs/php74-compat.neon - tests/phpstan/configs/php-bugs.neon - tests/phpstan/configs/phpstan-bugs.neon - tests/phpstan/configs/phpunit-wiring-tests.neon @@ -56,3 +57,6 @@ parameters: #we'll just fill it with 10 - it's very unlikely to encounter a callable with 10 parameters anyway. anyCallable: 'callable(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed' anyClosure: '\Closure(mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed, mixed) : mixed' + PhpSocket: '\Socket' + PhpCurlHandle: '\CurlHandle' + PhpOpenSSLAsymmetricKey: '\OpenSSLAsymmetricKey' diff --git a/phpstan.php7.neon b/phpstan.php7.neon new file mode 100644 index 000000000..2c6ef7729 --- /dev/null +++ b/phpstan.php7.neon @@ -0,0 +1,10 @@ +includes: + - phpstan.neon.dist + - tests/phpstan/configs/php7.neon + +parameters: + phpVersion: 70400 + typeAliases: + PhpSocket: resource + PhpCurlHandle: resource + PhpOpenSSLAsymmetricKey: resource diff --git a/phpstan.php8.neon b/phpstan.php8.neon deleted file mode 100644 index 2d5932c02..000000000 --- a/phpstan.php8.neon +++ /dev/null @@ -1,4 +0,0 @@ -includes: - - phpstan.neon.dist - - tests/phpstan/configs/php8.neon - diff --git a/src/network/mcpe/JwtUtils.php b/src/network/mcpe/JwtUtils.php index f2fb273c0..49ed2211a 100644 --- a/src/network/mcpe/JwtUtils.php +++ b/src/network/mcpe/JwtUtils.php @@ -97,7 +97,8 @@ final class JwtUtils{ } /** - * @param resource $signingKey + * @param \OpenSSLAsymmetricKey|resource $signingKey + * @phpstan-param PhpOpenSSLAsymmetricKey $signingKey * * @throws JwtException */ @@ -132,7 +133,8 @@ final class JwtUtils{ } /** - * @param resource $signingKey + * @param \OpenSSLAsymmetricKey|resource $signingKey + * @phpstan-param PhpOpenSSLAsymmetricKey $signingKey * * @phpstan-param array $header * @phpstan-param array $claims @@ -189,7 +191,8 @@ final class JwtUtils{ } /** - * @param resource $opensslKey + * @param \OpenSSLAsymmetricKey|resource $opensslKey + * @phpstan-param PhpOpenSSLAsymmetricKey $opensslKey */ public static function emitDerPublicKey($opensslKey) : string{ $details = openssl_pkey_get_details($opensslKey); @@ -209,7 +212,8 @@ final class JwtUtils{ } /** - * @return resource + * @return \OpenSSLAsymmetricKey|resource + * @phpstan-return PhpOpenSSLAsymmetricKey */ public static function parseDerPublicKey(string $derKey){ $signingKeyOpenSSL = openssl_pkey_get_public(sprintf("-----BEGIN PUBLIC KEY-----\n%s\n-----END PUBLIC KEY-----\n", base64_encode($derKey))); diff --git a/src/network/mcpe/encryption/EncryptionUtils.php b/src/network/mcpe/encryption/EncryptionUtils.php index 45682a300..a8e566221 100644 --- a/src/network/mcpe/encryption/EncryptionUtils.php +++ b/src/network/mcpe/encryption/EncryptionUtils.php @@ -41,8 +41,10 @@ final class EncryptionUtils{ } /** - * @param resource $localPriv - * @param resource $remotePub + * @param \OpenSSLAsymmetricKey|resource $localPriv + * @param \OpenSSLAsymmetricKey|resource $remotePub + * @phpstan-param PhpOpenSSLAsymmetricKey $localPriv + * @phpstan-param PhpOpenSSLAsymmetricKey $remotePub */ public static function generateSharedSecret($localPriv, $remotePub) : \GMP{ $hexSecret = openssl_pkey_derive($remotePub, $localPriv, 48); @@ -57,7 +59,8 @@ final class EncryptionUtils{ } /** - * @param resource $serverPriv + * @param \OpenSSLAsymmetricKey|resource $serverPriv + * @phpstan-param PhpOpenSSLAsymmetricKey $serverPriv */ public static function generateServerHandshakeJwt($serverPriv, string $salt) : string{ $derPublicKey = JwtUtils::emitDerPublicKey($serverPriv); diff --git a/src/network/mcpe/encryption/PrepareEncryptionTask.php b/src/network/mcpe/encryption/PrepareEncryptionTask.php index 036ab4286..b18a16d73 100644 --- a/src/network/mcpe/encryption/PrepareEncryptionTask.php +++ b/src/network/mcpe/encryption/PrepareEncryptionTask.php @@ -38,7 +38,10 @@ class PrepareEncryptionTask extends AsyncTask{ private const TLS_KEY_ON_COMPLETION = "completion"; - /** @var resource|null */ + /** + * @var \OpenSSLAsymmetricKey|resource|null + * @phpstan-var PhpOpenSSLAsymmetricKey|null + */ private static $SERVER_PRIVATE_KEY = null; /** @var string */ diff --git a/src/network/query/DedicatedQueryNetworkInterface.php b/src/network/query/DedicatedQueryNetworkInterface.php index 500d3e747..184b4f54a 100644 --- a/src/network/query/DedicatedQueryNetworkInterface.php +++ b/src/network/query/DedicatedQueryNetworkInterface.php @@ -63,7 +63,10 @@ final class DedicatedQueryNetworkInterface implements AdvancedNetworkInterface{ private $port; /** @var \Logger */ private $logger; - /** @var resource */ + /** + * @var \Socket|resource + * @phpstan-var PhpSocket + */ private $socket; /** @var Network */ private $network; diff --git a/src/utils/Internet.php b/src/utils/Internet.php index 987fa95b7..639f3f912 100644 --- a/src/utils/Internet.php +++ b/src/utils/Internet.php @@ -185,7 +185,7 @@ class Internet{ * @param \Closure|null $onSuccess function to be called if there is no error. Accepts a resource argument as the cURL handle. * @phpstan-param array $extraOpts * @phpstan-param list $extraHeaders - * @phpstan-param (\Closure(resource) : void)|null $onSuccess + * @phpstan-param (\Closure(PhpCurlHandle) : void)|null $onSuccess * * @throws InternetException if a cURL error occurs */ diff --git a/tests/phpstan/configs/check-explicit-mixed-baseline.neon b/tests/phpstan/configs/check-explicit-mixed-baseline.neon index c5c875fb5..71c18550f 100644 --- a/tests/phpstan/configs/check-explicit-mixed-baseline.neon +++ b/tests/phpstan/configs/check-explicit-mixed-baseline.neon @@ -41,7 +41,7 @@ parameters: path: ../../../src/ServerConfigGroup.php - - message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#" count: 1 path: ../../../src/ServerConfigGroup.php @@ -196,12 +196,12 @@ parameters: path: ../../../src/timings/TimingsHandler.php - - message: "#^Parameter \\#2 \\$start of function substr expects int, mixed given\\.$#" + message: "#^Parameter \\#2 \\$offset of function substr expects int, mixed given\\.$#" count: 1 path: ../../../src/utils/Internet.php - - message: "#^Parameter \\#3 \\$length of function substr expects int, mixed given\\.$#" + message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, mixed given\\.$#" count: 1 path: ../../../src/utils/Internet.php @@ -226,7 +226,7 @@ parameters: path: ../../../src/utils/Utils.php - - message: "#^Parameter \\#2 \\$input1 of function array_map expects array, mixed given\\.$#" + message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#" count: 1 path: ../../../src/utils/Utils.php @@ -245,28 +245,3 @@ parameters: count: 2 path: ../../../src/world/format/io/region/RegionWorldProvider.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../../phpunit/block/BlockTest.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 1 - path: ../../phpunit/block/BlockTest.php - - - - message: "#^Parameter \\#2 \\$array of static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) expects array\\|ArrayAccess, mixed given\\.$#" - count: 1 - path: ../../phpunit/block/BlockTest.php - - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: ../../phpunit/block/regenerate_consistency_check.php - - - - message: "#^Cannot access offset \\(int\\|string\\) on mixed\\.$#" - count: 3 - path: ../../phpunit/block/regenerate_consistency_check.php - diff --git a/tests/phpstan/configs/l7-baseline.neon b/tests/phpstan/configs/l7-baseline.neon index ff9421a41..4f5cbd83c 100644 --- a/tests/phpstan/configs/l7-baseline.neon +++ b/tests/phpstan/configs/l7-baseline.neon @@ -16,12 +16,12 @@ parameters: path: ../../../build/server-phar.php - - message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" count: 1 path: ../../../src/MemoryManager.php - - message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" count: 1 path: ../../../src/MemoryManager.php @@ -65,11 +65,6 @@ parameters: count: 1 path: ../../../src/Server.php - - - message: "#^Cannot cast array\\\\|string\\|false to int\\.$#" - count: 1 - path: ../../../src/ServerConfigGroup.php - - message: "#^Cannot cast array\\\\|string\\|false to string\\.$#" count: 1 @@ -451,22 +446,22 @@ parameters: path: ../../../src/command/defaults/PardonIpCommand.php - - message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" count: 2 path: ../../../src/command/defaults/TimingsCommand.php - - message: "#^Parameter \\#1 \\$fp of function fseek expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function fseek expects resource, resource\\|false given\\.$#" count: 1 path: ../../../src/command/defaults/TimingsCommand.php - - message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" count: 1 path: ../../../src/command/defaults/TimingsCommand.php - - message: "#^Parameter \\#1 \\$source of function stream_get_contents expects resource, resource\\|false given\\.$#" + message: "#^Parameter \\#1 \\$stream of function stream_get_contents expects resource, resource\\|false given\\.$#" count: 1 path: ../../../src/command/defaults/TimingsCommand.php @@ -561,7 +556,7 @@ parameters: path: ../../../src/entity/projectile/Projectile.php - - message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class\\-string\\\\|T of object, string given\\.$#" + message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\\\|T of object, string given\\.$#" count: 1 path: ../../../src/event/HandlerListManager.php @@ -576,7 +571,7 @@ parameters: path: ../../../src/item/Item.php - - message: "#^Parameter \\#2 \\$input1 of function array_map expects array, array\\|false given\\.$#" + message: "#^Parameter \\#2 \\$array of function array_map expects array, array\\|false given\\.$#" count: 1 path: ../../../src/lang/Language.php @@ -691,7 +686,12 @@ parameters: path: ../../../src/utils/Timezone.php - - message: "#^Parameter \\#1 \\$timezone_identifier of function date_default_timezone_set expects string, string\\|false given\\.$#" + message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" + count: 1 + path: ../../../src/utils/Timezone.php + + - + message: "#^Parameter \\#1 \\$timezoneId of function date_default_timezone_set expects string, string\\|false given\\.$#" count: 1 path: ../../../src/utils/Timezone.php diff --git a/tests/phpstan/configs/php7.neon b/tests/phpstan/configs/php7.neon new file mode 100644 index 000000000..b263cb1ca --- /dev/null +++ b/tests/phpstan/configs/php7.neon @@ -0,0 +1,67 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" + count: 1 + path: ../../../src/MemoryManager.php + + - + message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#" + count: 1 + path: ../../../src/MemoryManager.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: ../../../src/ServerConfigGroup.php + + - + message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" + count: 2 + path: ../../../src/command/defaults/TimingsCommand.php + + - + message: "#^Parameter \\#1 \\$fp of function fseek expects resource, resource\\|false given\\.$#" + count: 1 + path: ../../../src/command/defaults/TimingsCommand.php + + - + message: "#^Parameter \\#1 \\$fp of function fwrite expects resource, resource\\|false given\\.$#" + count: 1 + path: ../../../src/command/defaults/TimingsCommand.php + + - + message: "#^Parameter \\#1 \\$source of function stream_get_contents expects resource, resource\\|false given\\.$#" + count: 1 + path: ../../../src/command/defaults/TimingsCommand.php + + - + message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class\\-string\\\\|T of object, string given\\.$#" + count: 1 + path: ../../../src/event/HandlerListManager.php + + - + message: "#^Parameter \\#2 \\$input1 of function array_map expects array, array\\|false given\\.$#" + count: 1 + path: ../../../src/lang/Language.php + + - + message: "#^Parameter \\#2 \\$start of function substr expects int, mixed given\\.$#" + count: 1 + path: ../../../src/utils/Internet.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, mixed given\\.$#" + count: 1 + path: ../../../src/utils/Internet.php + + - + message: "#^Parameter \\#1 \\$timezone_identifier of function date_default_timezone_set expects string, string\\|false given\\.$#" + count: 1 + path: ../../../src/utils/Timezone.php + + - + message: "#^Parameter \\#2 \\$input1 of function array_map expects array, mixed given\\.$#" + count: 1 + path: ../../../src/utils/Utils.php + diff --git a/tests/phpstan/configs/php74-compat.neon b/tests/phpstan/configs/php74-compat.neon new file mode 100644 index 000000000..0ca093a67 --- /dev/null +++ b/tests/phpstan/configs/php74-compat.neon @@ -0,0 +1,12 @@ +parameters: + ignoreErrors: + - + message: "#^Strict comparison using \\=\\=\\= between array\\ and false will always evaluate to false\\.$#" + count: 1 + path: ../../../src/utils/Timezone.php + + - + message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#" + count: 1 + path: ../../../src/utils/Utils.php + diff --git a/tests/phpstan/configs/php8.neon b/tests/phpstan/configs/php8.neon deleted file mode 100644 index 6314d1777..000000000 --- a/tests/phpstan/configs/php8.neon +++ /dev/null @@ -1,182 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" - count: 1 - path: ../../../src/MemoryManager.php - - - - message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" - count: 1 - path: ../../../src/MemoryManager.php - - - - message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#" - count: 1 - path: ../../../src/ServerConfigGroup.php - - - - message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#" - count: 2 - path: ../../../src/command/defaults/TimingsCommand.php - - - - message: "#^Parameter \\#1 \\$stream of function fseek expects resource, resource\\|false given\\.$#" - count: 1 - path: ../../../src/command/defaults/TimingsCommand.php - - - - message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, resource\\|false given\\.$#" - count: 1 - path: ../../../src/command/defaults/TimingsCommand.php - - - - message: "#^Parameter \\#1 \\$stream of function stream_get_contents expects resource, resource\\|false given\\.$#" - count: 1 - path: ../../../src/command/defaults/TimingsCommand.php - - - - message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\\\|T of object, string given\\.$#" - count: 1 - path: ../../../src/event/HandlerListManager.php - - - - message: "#^Parameter \\#2 \\$array of function array_map expects array, array\\|false given\\.$#" - count: 1 - path: ../../../src/lang/Language.php - - - - message: "#^Method pocketmine\\\\network\\\\mcpe\\\\JwtUtils\\:\\:parseDerPublicKey\\(\\) should return resource but returns OpenSSLAsymmetricKey\\.$#" - count: 1 - path: ../../../src/network/mcpe/JwtUtils.php - - - - message: "#^Parameter \\#1 \\$key of function openssl_pkey_get_details expects OpenSSLAsymmetricKey, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/JwtUtils.php - - - - message: "#^Parameter \\#3 \\$private_key of function openssl_sign expects array\\|OpenSSLAsymmetricKey\\|OpenSSLCertificate\\|string, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/JwtUtils.php - - - - message: "#^Parameter \\#3 \\$public_key of function openssl_verify expects array\\|OpenSSLAsymmetricKey\\|OpenSSLCertificate\\|string, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/JwtUtils.php - - - - message: "#^Parameter \\#1 \\$key of function openssl_free_key expects OpenSSLAsymmetricKey, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/auth/ProcessLoginTask.php - - - - message: "#^Parameter \\#1 \\$public_key of function openssl_pkey_derive expects array\\|OpenSSLAsymmetricKey\\|OpenSSLCertificate\\|string, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/EncryptionUtils.php - - - - message: "#^Parameter \\#2 \\$private_key of function openssl_pkey_derive expects array\\|OpenSSLAsymmetricKey\\|OpenSSLCertificate\\|string, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/EncryptionUtils.php - - - - message: "#^Parameter \\#1 \\$key of function openssl_free_key expects OpenSSLAsymmetricKey, resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/PrepareEncryptionTask.php - - - - message: "#^Parameter \\#1 \\$key of function openssl_pkey_get_details expects OpenSSLAsymmetricKey, OpenSSLAsymmetricKey\\|resource given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/PrepareEncryptionTask.php - - - - message: "#^Parameter \\#1 \\$localPriv of static method pocketmine\\\\network\\\\mcpe\\\\encryption\\\\EncryptionUtils\\:\\:generateSharedSecret\\(\\) expects resource, OpenSSLAsymmetricKey given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/PrepareEncryptionTask.php - - - - message: "#^Parameter \\#1 \\$serverPriv of static method pocketmine\\\\network\\\\mcpe\\\\encryption\\\\EncryptionUtils\\:\\:generateServerHandshakeJwt\\(\\) expects resource, OpenSSLAsymmetricKey given\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/PrepareEncryptionTask.php - - - - message: "#^Static property pocketmine\\\\network\\\\mcpe\\\\encryption\\\\PrepareEncryptionTask\\:\\:\\$SERVER_PRIVATE_KEY \\(resource\\|null\\) does not accept OpenSSLAsymmetricKey\\.$#" - count: 1 - path: ../../../src/network/mcpe/encryption/PrepareEncryptionTask.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_bind expects Socket, resource given\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_close expects Socket, resource given\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_last_error expects Socket\\|null, resource given\\.$#" - count: 3 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_recvfrom expects Socket, resource given\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_sendto expects Socket, resource given\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$socket of function socket_set_nonblock expects Socket, resource given\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Property pocketmine\\\\network\\\\query\\\\DedicatedQueryNetworkInterface\\:\\:\\$socket \\(resource\\) does not accept Socket\\.$#" - count: 1 - path: ../../../src/network/query/DedicatedQueryNetworkInterface.php - - - - message: "#^Parameter \\#1 \\$ of closure expects resource, CurlHandle given\\.$#" - count: 1 - path: ../../../src/utils/Internet.php - - - - message: "#^Parameter \\#2 \\$offset of function substr expects int, mixed given\\.$#" - count: 1 - path: ../../../src/utils/Internet.php - - - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, mixed given\\.$#" - count: 1 - path: ../../../src/utils/Internet.php - - - - message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#" - count: 1 - path: ../../../src/utils/Timezone.php - - - - message: "#^Parameter \\#1 \\$timezoneId of function date_default_timezone_set expects string, string\\|false given\\.$#" - count: 1 - path: ../../../src/utils/Timezone.php - - - - message: "#^Strict comparison using \\=\\=\\= between array\\ and false will always evaluate to false\\.$#" - count: 1 - path: ../../../src/utils/Timezone.php - - - - message: "#^Parameter \\#2 \\$array of function array_map expects array, mixed given\\.$#" - count: 1 - path: ../../../src/utils/Utils.php - - - - message: "#^Strict comparison using \\=\\=\\= between array and false will always evaluate to false\\.$#" - count: 1 - path: ../../../src/utils/Utils.php - diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index b484b3e8b..3e0dab33b 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -30,6 +30,11 @@ parameters: count: 1 path: ../../../src/entity/projectile/Projectile.php + - + message: "#^Parameter \\#1 \\$read of function socket_select expects array\\\\|null, array\\ given\\.$#" + count: 1 + path: ../../../src/network/query/DedicatedQueryNetworkInterface.php + - message: "#^Parameter \\#1 \\$ of closure expects TValue, TValue given\\.$#" count: 2