diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 5a23b55c..a4a2ea0f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Composer normalize uses: docker://ergebnis/composer-normalize-action diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e91212db..15fed93e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: extensions: mbstring - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install dependencies run: composer update --no-interaction --prefer-stable --prefer-lowest --no-progress @@ -45,7 +45,7 @@ jobs: extensions: mbstring - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Mimic PHP 8.0 run: composer config platform.php 8.0.999 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index fbe5a9b4..6003e890 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -24,7 +24,7 @@ jobs: coverage: none - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Mimic PHP 8.0 run: composer config platform.php 8.0.999 diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 699863c1..8aea52bb 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -13,7 +13,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -38,7 +38,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -63,7 +63,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3f47c8de..bc2f5a0e 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,20 @@ parameters: ignoreErrors: + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/AppendStream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/CachingStream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/DroppingStream.php + - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn___toString\\.$#" count: 1 @@ -16,17 +31,27 @@ parameters: path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getSize\\.$#" + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_eof\\.$#" count: 1 path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_tell\\.$#" + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getContents\\.$#" count: 1 path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_eof\\.$#" + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getMetadata\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getSize\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_isReadable\\.$#" count: 1 path: src/FnStream.php @@ -35,6 +60,16 @@ parameters: count: 1 path: src/FnStream.php + - + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_isWritable\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_read\\.$#" + count: 1 + path: src/FnStream.php + - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_rewind\\.$#" count: 1 @@ -46,7 +81,7 @@ parameters: path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_isWritable\\.$#" + message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_tell\\.$#" count: 1 path: src/FnStream.php @@ -56,22 +91,62 @@ parameters: path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_isReadable\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:__toString\\(\\) should return string but returns mixed\\.$#" count: 1 path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_read\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:detach\\(\\) should return resource\\|null but returns mixed\\.$#" count: 1 path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getContents\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:eof\\(\\) should return bool but returns mixed\\.$#" count: 1 path: src/FnStream.php - - message: "#^Access to an undefined property GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:\\$_fn_getMetadata\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:getContents\\(\\) should return string but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:getSize\\(\\) should return int\\|null but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:isReadable\\(\\) should return bool but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:isSeekable\\(\\) should return bool but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:isWritable\\(\\) should return bool but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:read\\(\\) should return string but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:tell\\(\\) should return int but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\FnStream\\:\\:write\\(\\) should return int but returns mixed\\.$#" + count: 1 + path: src/FnStream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 path: src/FnStream.php @@ -81,14 +156,19 @@ parameters: path: src/Header.php - - message: "#^Parameter \\#2 \\$subject of function preg_match_all expects string, string\\|null given\\.$#" + message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 - path: src/Message.php + path: src/InflateStream.php - - message: "#^Variable \\$headerLines in PHPDoc tag @var does not match assigned variable \\$count\\.$#" + message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 - path: src/Message.php + path: src/LazyOpenStream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/LimitStream.php - message: "#^Parameter \\#1 \\$haystack of function substr_count expects string, string\\|null given\\.$#" @@ -101,37 +181,92 @@ parameters: path: src/Message.php - - message: "#^Parameter \\#1 \\$path of function basename expects string, string\\|null given\\.$#" + message: "#^Parameter \\#2 \\$subject of function preg_match_all expects string, string\\|null given\\.$#" count: 1 - path: src/MultipartStream.php + path: src/Message.php + + - + message: "#^Variable \\$headerLines in PHPDoc tag @var does not match assigned variable \\$count\\.$#" + count: 1 + path: src/Message.php - - message: "#^Parameter \\#1 \\$filename of static method GuzzleHttp\\\\Psr7\\\\MimeType\\:\\:fromFilename\\(\\) expects string, string\\|null given\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\MultipartStream\\:\\:getHeader\\(\\) has no return type specified\\.$#" count: 1 path: src/MultipartStream.php - - message: "#^Method GuzzleHttp\\\\Psr7\\\\MultipartStream\\:\\:getHeader\\(\\) has no return typehint specified\\.$#" + message: "#^Unreachable statement \\- code above always terminates\\.$#" count: 1 path: src/MultipartStream.php + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/NoSeekStream.php + + - + message: "#^Parameter \\#1 \\$string of function strlen expects string, mixed given\\.$#" + count: 1 + path: src/PumpStream.php + + - + message: "#^Parameter \\#1 \\$string of method GuzzleHttp\\\\Psr7\\\\BufferStream\\:\\:write\\(\\) expects string, mixed given\\.$#" + count: 1 + path: src/PumpStream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/PumpStream.php + + - + message: "#^Parameter \\#2 \\$subject of function preg_match expects string, mixed given\\.$#" + count: 1 + path: src/Request.php + + - + message: "#^Property GuzzleHttp\\\\Psr7\\\\Request\\:\\:\\$requestTarget \\(string\\|null\\) does not accept mixed\\.$#" + count: 1 + path: src/Request.php + - message: "#^Method GuzzleHttp\\\\Psr7\\\\ServerRequest\\:\\:normalizeNestedFileSpec\\(\\) should return array\\ but returns array\\\\|Psr\\\\Http\\\\Message\\\\UploadedFileInterface\\>\\.$#" count: 1 path: src/ServerRequest.php + - + message: "#^Offset 'size' on array\\{0\\: int, 1\\: int, 2\\: int, 3\\: int, 4\\: int, 5\\: int, 6\\: int, 7\\: int, \\.\\.\\.\\} in isset\\(\\) always exists and is not nullable\\.$#" + count: 1 + path: src/Stream.php + + - + message: "#^Property GuzzleHttp\\\\Psr7\\\\Stream\\:\\:\\$stream \\(resource\\) in isset\\(\\) is not nullable\\.$#" + count: 10 + path: src/Stream.php + + - + message: "#^Property GuzzleHttp\\\\Psr7\\\\Stream\\:\\:\\$uri \\(string\\|null\\) does not accept mixed\\.$#" + count: 1 + path: src/Stream.php + + - + message: "#^Unreachable statement \\- code above always terminates\\.$#" + count: 1 + path: src/Stream.php + - message: "#^Method GuzzleHttp\\\\Psr7\\\\StreamWrapper\\:\\:getResource\\(\\) should return resource but returns resource\\|false\\.$#" count: 1 path: src/StreamWrapper.php - - message: "#^Method GuzzleHttp\\\\Psr7\\\\UploadedFile\\:\\:isStringNotEmpty\\(\\) has parameter \\$param with no typehint specified\\.$#" + message: "#^Method GuzzleHttp\\\\Psr7\\\\UploadedFile\\:\\:isStringNotEmpty\\(\\) has parameter \\$param with no type specified\\.$#" count: 1 path: src/UploadedFile.php - - message: "#^Method GuzzleHttp\\\\Psr7\\\\Uri\\:\\:filterUserInfoComponent\\(\\) should return string but returns string\\|null\\.$#" + message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Uri.php @@ -145,6 +280,16 @@ parameters: count: 1 path: src/Uri.php + - + message: "#^Method GuzzleHttp\\\\Psr7\\\\Uri\\:\\:filterUserInfoComponent\\(\\) should return string but returns string\\|null\\.$#" + count: 1 + path: src/Uri.php + + - + message: "#^Parameter \\#1 \\$callback of function array_map expects \\(callable\\(int\\|string\\)\\: mixed\\)\\|null, 'urldecode' given\\.$#" + count: 1 + path: src/Uri.php + - message: "#^Parameter \\#1 \\$path of method Psr\\\\Http\\\\Message\\\\UriInterface\\:\\:withPath\\(\\) expects string, string\\|null given\\.$#" count: 3 @@ -155,13 +300,23 @@ parameters: count: 2 path: src/UriNormalizer.php + - + message: "#^Strict comparison using \\=\\=\\= between '' and non\\-empty\\-string will always evaluate to false\\.$#" + count: 1 + path: src/UriResolver.php + + - + message: "#^Offset 'uri' on array\\{timed_out\\: bool, blocked\\: bool, eof\\: bool, unread_bytes\\: int, stream_type\\: string, wrapper_type\\: string, wrapper_data\\: mixed, mode\\: string, \\.\\.\\.\\} on left side of \\?\\? always exists and is not nullable\\.$#" + count: 1 + path: src/Utils.php + - message: "#^Parameter \\#1 \\$keys of static method GuzzleHttp\\\\Psr7\\\\Utils\\:\\:caselessRemove\\(\\) expects array\\, array\\ given\\.$#" count: 1 path: src/Utils.php - - message: "#^Variable \\$handle might not be defined\\.$#" + message: "#^Parameter \\#1 \\$source of class GuzzleHttp\\\\Psr7\\\\PumpStream constructor expects callable\\(int\\)\\: string\\|false\\|null, Closure\\(\\)\\: mixed given\\.$#" count: 1 path: src/Utils.php @@ -170,3 +325,8 @@ parameters: count: 1 path: src/Utils.php + - + message: "#^Variable \\$handle might not be defined\\.$#" + count: 1 + path: src/Utils.php + diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 6b1adaee..cdc2655c 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -54,16 +54,16 @@ array array - + + $header + $header + $header + $header $header $header - - $element['filename'] ?? null - $uri - $filename $filename @@ -76,9 +76,6 @@ isset($this->headerNames['host']) - - assertMethod - @@ -87,7 +84,8 @@ UploadedFileInterface[] - + + $attribute $attribute $attribute @@ -132,8 +130,5 @@ $handle - - (bool) $rawOutput - diff --git a/vendor-bin/php-cs-fixer/composer.json b/vendor-bin/php-cs-fixer/composer.json index d69a683b..5c4b374f 100644 --- a/vendor-bin/php-cs-fixer/composer.json +++ b/vendor-bin/php-cs-fixer/composer.json @@ -1,7 +1,7 @@ { "require": { - "php": "^7.2.5 || ^8.0", - "friendsofphp/php-cs-fixer": "3.2.1" + "php": "^7.4 || ^8.0", + "friendsofphp/php-cs-fixer": "3.7.0" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/phpstan/composer.json b/vendor-bin/phpstan/composer.json index bfbc7273..12065e27 100644 --- a/vendor-bin/phpstan/composer.json +++ b/vendor-bin/phpstan/composer.json @@ -1,8 +1,8 @@ { "require": { - "php": "^7.2.5 || ^8.0", - "phpstan/phpstan": "0.12.81", - "phpstan/phpstan-deprecation-rules": "0.12.6" + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "1.4.9", + "phpstan/phpstan-deprecation-rules": "1.0.0" }, "config": { "preferred-install": "dist" diff --git a/vendor-bin/psalm/composer.json b/vendor-bin/psalm/composer.json index 535a0797..0c0ac2c3 100644 --- a/vendor-bin/psalm/composer.json +++ b/vendor-bin/psalm/composer.json @@ -1,7 +1,7 @@ { "require": { - "php": "^7.2.5 || ^8.0", - "psalm/phar": "4.6.2" + "php": "^7.4 || ^8.0", + "psalm/phar": "4.22.0" }, "config": { "preferred-install": "dist"