1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-01-16 21:08:13 +01:00

PHP 8.4 support (#3233)

This commit is contained in:
Graham Campbell 2024-07-18 11:39:23 +01:00 committed by GitHub
parent 429cb67026
commit 367c5d4afa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 79 additions and 71 deletions

View File

@ -51,13 +51,11 @@ jobs:
strategy: strategy:
max-parallel: 10 max-parallel: 10
matrix: matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
psr7: ['^1.9.1', '^2.5.1'] psr7: ['^1.9.1', '^2.6.3']
include: include:
- php: '8.0' - php: '8.4'
psr7: '^1.9.1@dev' psr7: '^2.6.3@dev'
- php: '8.3'
psr7: '^2.5.1@dev'
exclude: exclude:
- php: '8.1' - php: '8.1'
psr7: '^1.9.1' psr7: '^1.9.1'
@ -65,6 +63,8 @@ jobs:
psr7: '^1.9.1' psr7: '^1.9.1'
- php: '8.3' - php: '8.3'
psr7: '^1.9.1' psr7: '^1.9.1'
- php: '8.4'
psr7: '^1.9.1'
steps: steps:
- name: Set up PHP - name: Set up PHP
@ -106,7 +106,7 @@ jobs:
strategy: strategy:
max-parallel: 10 max-parallel: 10
matrix: matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
steps: steps:
- name: Set up PHP - name: Set up PHP

View File

@ -81,8 +81,8 @@
"require": { "require": {
"php": "^7.2.5 || ^8.0", "php": "^7.2.5 || ^8.0",
"ext-json": "*", "ext-json": "*",
"guzzlehttp/promises": "^1.5.3 || ^2.0.1", "guzzlehttp/promises": "^1.5.3 || ^2.0.3",
"guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "guzzlehttp/psr7": "^1.9.1 || ^2.6.3",
"psr/http-client": "^1.0", "psr/http-client": "^1.0",
"symfony/deprecation-contracts": "^2.2 || ^3.0" "symfony/deprecation-contracts": "^2.2 || ^3.0"
}, },
@ -94,7 +94,7 @@
"bamarni/composer-bin-plugin": "^1.8.2", "bamarni/composer-bin-plugin": "^1.8.2",
"guzzle/client-integration-tests": "3.0.2", "guzzle/client-integration-tests": "3.0.2",
"php-http/message-factory": "^1.1", "php-http/message-factory": "^1.1",
"phpunit/phpunit": "^8.5.36 || ^9.6.15", "phpunit/phpunit": "^8.5.39 || ^9.6.20",
"psr/log": "^1.1 || ^2.0 || ^3.0" "psr/log": "^1.1 || ^2.0 || ^3.0"
}, },
"suggest": { "suggest": {

View File

@ -145,6 +145,11 @@ parameters:
count: 1 count: 1
path: src/Handler/CurlMultiHandler.php path: src/Handler/CurlMultiHandler.php
-
message: "#^Strict comparison using \\=\\=\\= between false and resource will always evaluate to false\\.$#"
count: 1
path: src/Handler/CurlMultiHandler.php
- -
message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$handle has unknown class CurlHandle as its type\\.$#" message: "#^Property GuzzleHttp\\\\Handler\\\\EasyHandle\\:\\:\\$handle has unknown class CurlHandle as its type\\.$#"
count: 1 count: 1

View File

@ -3,8 +3,10 @@ includes:
- vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon - vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon
parameters: parameters:
ignoreErrors:
-
identifier: missingType.iterableValue
level: max level: max
checkMissingIterableValueType: false
paths: paths:
- src - src
bootstrapFiles: bootstrapFiles:

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352"> <files psalm-version="5.25.0@01a8eb06b9e9cc6cfb6a320bf9fb14331919d505">
<file src="src/Client.php"> <file src="src/Client.php">
<PossiblyUndefinedVariable> <PossiblyUndefinedVariable>
<code>$options</code> <code><![CDATA[$options]]></code>
</PossiblyUndefinedVariable> </PossiblyUndefinedVariable>
<UndefinedInterfaceMethod> <UndefinedInterfaceMethod>
<code>getBoundary</code> <code><![CDATA[getBoundary]]></code>
</UndefinedInterfaceMethod> </UndefinedInterfaceMethod>
</file> </file>
<file src="src/Cookie/CookieJar.php"> <file src="src/Cookie/CookieJar.php">
@ -16,42 +16,42 @@
<code><![CDATA[\ArrayIterator<int, SetCookie>]]></code> <code><![CDATA[\ArrayIterator<int, SetCookie>]]></code>
</InvalidReturnType> </InvalidReturnType>
<PossiblyFalseOperand> <PossiblyFalseOperand>
<code>$result</code> <code><![CDATA[$result]]></code>
</PossiblyFalseOperand> </PossiblyFalseOperand>
</file> </file>
<file src="src/Cookie/SetCookie.php"> <file src="src/Cookie/SetCookie.php">
<RedundantCast> <RedundantCast>
<code>(bool) $discard</code> <code><![CDATA[(bool) $discard]]></code>
<code>(bool) $httpOnly</code> <code><![CDATA[(bool) $httpOnly]]></code>
<code>(bool) $secure</code> <code><![CDATA[(bool) $secure]]></code>
<code>(int) $maxAge</code> <code><![CDATA[(int) $maxAge]]></code>
<code>(string) $domain</code> <code><![CDATA[(string) $domain]]></code>
<code>(string) $name</code> <code><![CDATA[(string) $name]]></code>
<code>(string) $path</code> <code><![CDATA[(string) $path]]></code>
<code>(string) $timestamp</code> <code><![CDATA[(string) $timestamp]]></code>
<code>(string) $value</code> <code><![CDATA[(string) $value]]></code>
</RedundantCast> </RedundantCast>
<UndefinedFunction> <UndefinedFunction>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a bool to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing a string to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<code>trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)</code> <code><![CDATA[trigger_deprecation('guzzlehttp/guzzle', '7.4', 'Not passing an int or null to %s::%s() is deprecated and will cause an error in 8.0.', __CLASS__, __FUNCTION__)]]></code>
<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> <code><![CDATA[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>
</UndefinedFunction> </UndefinedFunction>
</file> </file>
<file src="src/Handler/CurlFactory.php"> <file src="src/Handler/CurlFactory.php">
<FalseOperand> <FalseOperand>
<code>$timeoutRequiresNoSignal</code> <code><![CDATA[$timeoutRequiresNoSignal]]></code>
</FalseOperand> </FalseOperand>
<InvalidOperand> <InvalidOperand>
<code><![CDATA[$options['connect_timeout'] < 1]]></code> <code><![CDATA[$options['connect_timeout'] < 1]]></code>
</InvalidOperand> </InvalidOperand>
<PossiblyFalseOperand> <PossiblyFalseOperand>
<code>$timeoutRequiresNoSignal</code> <code><![CDATA[$timeoutRequiresNoSignal]]></code>
</PossiblyFalseOperand> </PossiblyFalseOperand>
<PossiblyInvalidArgument> <PossiblyInvalidArgument>
<code><![CDATA[$easy->handle]]></code> <code><![CDATA[$easy->handle]]></code>
@ -60,22 +60,25 @@
<code><![CDATA[$easy->handle]]></code> <code><![CDATA[$easy->handle]]></code>
<code><![CDATA[$easy->handle]]></code> <code><![CDATA[$easy->handle]]></code>
<code><![CDATA[$easy->handle]]></code> <code><![CDATA[$easy->handle]]></code>
<code>$handle</code> <code><![CDATA[$handle]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$resource</code> <code><![CDATA[$resource]]></code>
<code>$sslKey</code> <code><![CDATA[$sslKey]]></code>
</PossiblyInvalidArgument> </PossiblyInvalidArgument>
<PossiblyInvalidCast> <PossiblyInvalidCast>
<code>$sslKey</code> <code><![CDATA[$sslKey]]></code>
</PossiblyInvalidCast> </PossiblyInvalidCast>
<UndefinedDocblockClass> <UndefinedDocblockClass>
<code>private $handles = [];</code> <code><![CDATA[private $handles = [];]]></code>
<code>resource[]|\CurlHandle[]</code> <code><![CDATA[resource[]|\CurlHandle[]]]></code>
</UndefinedDocblockClass> </UndefinedDocblockClass>
<UndefinedVariable>
<code><![CDATA[$startingResponse]]></code>
</UndefinedVariable>
</file> </file>
<file src="src/Handler/CurlHandler.php"> <file src="src/Handler/CurlHandler.php">
<PossiblyInvalidArgument> <PossiblyInvalidArgument>
@ -104,36 +107,37 @@
<code><![CDATA[isset($this->_mh)]]></code> <code><![CDATA[isset($this->_mh)]]></code>
</RedundantPropertyInitializationCheck> </RedundantPropertyInitializationCheck>
<TypeDoesNotContainType> <TypeDoesNotContainType>
<code>false === $multiHandle</code> <code><![CDATA[false === $multiHandle]]></code>
</TypeDoesNotContainType> </TypeDoesNotContainType>
<UndefinedDocblockClass> <UndefinedDocblockClass>
<code>resource|\CurlMultiHandle</code> <code><![CDATA[resource|\CurlMultiHandle]]></code>
<code>resource|\CurlMultiHandle</code> <code><![CDATA[resource|\CurlMultiHandle]]></code>
</UndefinedDocblockClass> </UndefinedDocblockClass>
<UndefinedFunction> <UndefinedFunction>
<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> <code><![CDATA[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>
</UndefinedFunction> </UndefinedFunction>
</file> </file>
<file src="src/Handler/EasyHandle.php"> <file src="src/Handler/EasyHandle.php">
<InvalidReturnType> <InvalidReturnType>
<code>void</code> <code><![CDATA[void]]></code>
</InvalidReturnType> </InvalidReturnType>
<UndefinedDocblockClass> <UndefinedDocblockClass>
<code>resource|\CurlHandle</code> <code><![CDATA[resource|\CurlHandle]]></code>
</UndefinedDocblockClass> </UndefinedDocblockClass>
</file> </file>
<file src="src/Handler/MockHandler.php"> <file src="src/Handler/MockHandler.php">
<ArgumentTypeCoercion> <ArgumentTypeCoercion>
<code>(int) $options['delay'] * 1000</code> <code><![CDATA[(int) $options['delay'] * 1000]]></code>
</ArgumentTypeCoercion> </ArgumentTypeCoercion>
</file> </file>
<file src="src/Handler/StreamHandler.php"> <file src="src/Handler/StreamHandler.php">
<ImplicitToStringCast>
<code>$uri</code>
</ImplicitToStringCast>
<RedundantCondition> <RedundantCondition>
<code>empty($options)</code> <code><![CDATA[!empty($options)]]></code>
<code><![CDATA[empty($options)]]></code>
</RedundantCondition> </RedundantCondition>
<UndefinedVariable>
<code><![CDATA[$http_response_header]]></code>
</UndefinedVariable>
</file> </file>
<file src="src/MessageFormatter.php"> <file src="src/MessageFormatter.php">
<InvalidArgument> <InvalidArgument>
@ -246,14 +250,9 @@
</file> </file>
<file src="src/Middleware.php"> <file src="src/Middleware.php">
<InvalidArgument> <InvalidArgument>
<code>$request</code> <code><![CDATA[$request]]></code>
</InvalidArgument> </InvalidArgument>
</file> </file>
<file src="src/RedirectMiddleware.php">
<ImplicitToStringCast>
<code>$location</code>
</ImplicitToStringCast>
</file>
<file src="src/RetryMiddleware.php"> <file src="src/RetryMiddleware.php">
<TooManyArguments> <TooManyArguments>
<code><![CDATA[($this->delay)(++$options['retries'], $response, $request)]]></code> <code><![CDATA[($this->delay)(++$options['retries'], $response, $request)]]></code>
@ -261,14 +260,14 @@
</file> </file>
<file src="src/Utils.php"> <file src="src/Utils.php">
<ArgumentTypeCoercion> <ArgumentTypeCoercion>
<code>$depth</code> <code><![CDATA[$depth]]></code>
<code>$depth</code> <code><![CDATA[$depth]]></code>
</ArgumentTypeCoercion> </ArgumentTypeCoercion>
<ForbiddenCode> <ForbiddenCode>
<code>\var_dump($input)</code> <code><![CDATA[\var_dump($input)]]></code>
</ForbiddenCode> </ForbiddenCode>
<PossiblyInvalidCast> <PossiblyInvalidCast>
<code>$_SERVER[$name]</code> <code><![CDATA[$_SERVER[$name]]]></code>
</PossiblyInvalidCast> </PossiblyInvalidCast>
</file> </file>
</files> </files>

View File

@ -6,6 +6,8 @@
xmlns="https://getpsalm.org/schema/config" xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="psalm-baseline.xml" errorBaseline="psalm-baseline.xml"
findUnusedBaselineEntry="true"
findUnusedCode="false"
> >
<projectFiles> <projectFiles>
<directory name="src" /> <directory name="src" />

View File

@ -1,7 +1,7 @@
{ {
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"friendsofphp/php-cs-fixer": "3.52.1" "friendsofphp/php-cs-fixer": "3.59.3"
}, },
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist"

View File

@ -1,8 +1,8 @@
{ {
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^7.4 || ^8.0",
"phpstan/phpstan": "1.10.47", "phpstan/phpstan": "1.11.7",
"phpstan/phpstan-deprecation-rules": "1.1.4" "phpstan/phpstan-deprecation-rules": "1.2.0"
}, },
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist"

View File

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