1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-03-14 19:29:49 +01:00

Upgrade SA tools (#3067)

This commit is contained in:
Graham Campbell 2022-08-28 16:28:05 +01:00 committed by GitHub
parent be2902f14e
commit 546ac3f054
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 93 additions and 34 deletions

View File

@ -74,10 +74,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Mimic PHP 8.1
run: composer config platform.php 8.1.999
if: matrix.php > 8.1
- name: Download dependencies
run: |
composer require --no-update "guzzlehttp/psr7:${{ matrix.psr7 }}"
@ -113,10 +109,6 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
- name: Mimic PHP 8.1
run: composer config platform.php 8.1.999
if: matrix.php > 8.1
- name: Download dependencies
run: composer update --no-interaction --no-progress

View File

@ -63,9 +63,9 @@
},
"require-dev": {
"ext-curl": "*",
"bamarni/composer-bin-plugin": "^1.4.1",
"bamarni/composer-bin-plugin": "^1.8.1",
"php-http/client-integration-tests": "^3.0",
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
"phpunit/phpunit": "^8.5.29 || ^9.5.23",
"psr/log": "^1.1 || ^2.0 || ^3.0"
},
"suggest": {
@ -81,6 +81,10 @@
"sort-packages": true
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": false
},
"branch-alias": {
"dev-master": "7.5-dev"
}

View File

@ -1,10 +1,30 @@
parameters:
ignoreErrors:
-
message: "#^Method GuzzleHttp\\\\Client\\:\\:request\\(\\) should return Psr\\\\Http\\\\Message\\\\ResponseInterface but returns mixed\\.$#"
count: 1
path: src/Client.php
-
message: "#^Method GuzzleHttp\\\\Client\\:\\:send\\(\\) should return Psr\\\\Http\\\\Message\\\\ResponseInterface but returns mixed\\.$#"
count: 1
path: src/Client.php
-
message: "#^Method GuzzleHttp\\\\Client\\:\\:sendRequest\\(\\) should return Psr\\\\Http\\\\Message\\\\ResponseInterface but returns mixed\\.$#"
count: 1
path: src/Client.php
-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, int\\|string given\\.$#"
count: 1
path: src/Client.php
-
message: "#^Parameter \\#1 \\$string of function strlen expects string, mixed given\\.$#"
count: 1
path: src/Cookie/SessionCookieJar.php
-
message: "#^Result of && is always false\\.$#"
count: 3
@ -15,6 +35,16 @@ parameters:
count: 3
path: src/Cookie/SetCookie.php
-
message: "#^Unsafe call to private method GuzzleHttp\\\\Exception\\\\RequestException\\:\\:obfuscateUri\\(\\) through static\\:\\:\\.$#"
count: 1
path: src/Exception/RequestException.php
-
message: "#^Binary operation \"\\+\" between array\\{errno\\: int, error\\: string, appconnect_time\\: float\\} and \\(array\\{url\\: string, content_type\\: string\\|null, http_code\\: int, header_size\\: int, request_size\\: int, filetime\\: int, ssl_verify_result\\: int, redirect_count\\: int, \\.\\.\\.\\}\\|false\\) results in an error\\.$#"
count: 1
path: src/Handler/CurlFactory.php
-
message: "#^Cannot access offset 'version' on array\\|false\\.$#"
count: 1
@ -75,6 +105,11 @@ parameters:
count: 1
path: src/Handler/CurlHandler.php
-
message: "#^Method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has invalid return type CurlMultiHandle\\.$#"
count: 1
path: src/Handler/CurlMultiHandler.php
-
message: "#^Parameter \\#1 \\$mh of function curl_multi_add_handle expects resource, CurlMultiHandle\\|resource given\\.$#"
count: 2
@ -105,16 +140,21 @@ parameters:
count: 1
path: src/Handler/CurlMultiHandler.php
-
message: "#^Return typehint of method GuzzleHttp\\\\Handler\\\\CurlMultiHandler\\:\\:__get\\(\\) has invalid type CurlMultiHandle\\.$#"
count: 1
path: src/Handler/CurlMultiHandler.php
-
message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$handle has unknown class CurlHandle as its type\\.$#"
count: 1
path: src/Handler/EasyHandle.php
-
message: "#^Trying to invoke mixed but it's not a callable\\.$#"
count: 1
path: src/Handler/StreamHandler.php
-
message: "#^Variable \\$http_response_header on left side of \\?\\? always exists and is not nullable\\.$#"
count: 1
path: src/Handler/StreamHandler.php
-
message: "#^Result of && is always false\\.$#"
count: 1
@ -125,3 +165,28 @@ parameters:
count: 2
path: src/Middleware.php
-
message: "#^Method GuzzleHttp\\\\Utils\\:\\:jsonDecode\\(\\) should return array\\|bool\\|float\\|int\\|object\\|string\\|null but returns mixed\\.$#"
count: 1
path: src/Utils.php
-
message: "#^Parameter \\#1 \\$object of function get_class expects object, mixed given\\.$#"
count: 1
path: src/Utils.php
-
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
count: 1
path: src/Utils.php
-
message: "#^Parameter \\#3 \\$depth of function json_decode expects int\\<1, max\\>, int given\\.$#"
count: 1
path: src/Utils.php
-
message: "#^Parameter \\#3 \\$depth of function json_encode expects int\\<1, max\\>, int given\\.$#"
count: 1
path: src/Utils.php

View File

@ -37,11 +37,6 @@
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int, string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code>
</TooManyArguments>
</file>
<file src="src/Exception/RequestException.php">
<ImplicitToStringCast occurrences="1">
<code>$uri</code>
</ImplicitToStringCast>
</file>
<file src="src/Handler/CurlFactory.php">
<FalseOperand occurrences="1">
<code>$timeoutRequiresNoSignal</code>
@ -82,9 +77,9 @@
</PossiblyInvalidArgument>
</file>
<file src="src/Handler/CurlMultiHandler.php">
<InvalidPropertyAssignmentValue occurrences="1">
<code>$this-&gt;active</code>
</InvalidPropertyAssignmentValue>
<ArgumentTypeCoercion occurrences="1">
<code>$this-&gt;timeToNext()</code>
</ArgumentTypeCoercion>
<PossiblyInvalidArgument occurrences="7">
<code>$this-&gt;_mh</code>
<code>$this-&gt;_mh</code>
@ -97,9 +92,8 @@
<TooManyArguments occurrences="1">
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an integer to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code>
</TooManyArguments>
<UndefinedDocblockClass occurrences="2">
<UndefinedDocblockClass occurrences="1">
<code>resource|\CurlMultiHandle</code>
<code>resource|\CurlMultiHandle|null</code>
</UndefinedDocblockClass>
<UndefinedThisPropertyAssignment occurrences="1">
<code>$this-&gt;_mh</code>
@ -110,6 +104,11 @@
<code>resource|\CurlHandle</code>
</UndefinedDocblockClass>
</file>
<file src="src/Handler/MockHandler.php">
<ArgumentTypeCoercion occurrences="1">
<code>(int) $options['delay'] * 1000</code>
</ArgumentTypeCoercion>
</file>
<file src="src/Handler/StreamHandler.php">
<ImplicitToStringCast occurrences="1">
<code>$uri</code>
@ -141,7 +140,7 @@
</file>
<file src="src/RetryMiddleware.php">
<TooManyArguments occurrences="1">
<code>($this-&gt;delay)(++$options['retries'], $response)</code>
<code>($this-&gt;delay)(++$options['retries'], $response, $request)</code>
</TooManyArguments>
</file>
<file src="src/Utils.php">

View File

@ -178,7 +178,6 @@ class CookieJar implements CookieJarInterface
// Resolve conflicts with previously set cookies
foreach ($this->cookies as $i => $c) {
// Two cookies are identical, when their path, and domain are
// identical.
if ($c->getPath() != $cookie->getPath() ||

View File

@ -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.10.0"
},
"config": {
"preferred-install": "dist"

View File

@ -1,8 +1,8 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"phpstan/phpstan": "0.12.99",
"phpstan/phpstan-deprecation-rules": "0.12.6"
"php": "^7.4 || ^8.0",
"phpstan/phpstan": "1.8.2",
"phpstan/phpstan-deprecation-rules": "1.0.0"
},
"config": {
"preferred-install": "dist"

View File

@ -1,7 +1,7 @@
{
"require": {
"php": "^7.2.5 || ^8.0",
"psalm/phar": "4.10.0"
"php": "^7.4 || ^8.0",
"psalm/phar": "4.26.0"
},
"config": {
"preferred-install": "dist"