Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ permissions:
jobs:
composer-normalize:
name: Composer Normalize
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Composer normalize
uses: docker://ergebnis/composer-normalize-action
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
build-lowest-version:
name: Build lowest version
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Set up PHP
Expand All @@ -23,7 +23,7 @@ jobs:
extensions: mbstring

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install dependencies
run: composer update --no-interaction --prefer-stable --prefer-lowest --no-progress
Expand All @@ -33,11 +33,11 @@ jobs:

build:
name: Build
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
max-parallel: 10
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']

steps:
- name: Set up PHP
Expand All @@ -49,7 +49,7 @@ jobs:
extensions: mbstring

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install dependencies
run: composer update --no-interaction --no-progress
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ permissions:
jobs:
build:
name: Test
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
max-parallel: 10
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']

steps:
- name: Set up PHP
Expand All @@ -26,7 +26,7 @@ jobs:
coverage: none

- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Install dependencies
run: composer update --no-interaction --no-progress
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ permissions:
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
coverage: none
extensions: mbstring

Expand All @@ -35,11 +35,11 @@ jobs:

php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -59,16 +59,16 @@ jobs:

psalm:
name: Psalm
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.2'
coverage: none
extensions: mbstring

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"require-dev": {
"bamarni/composer-bin-plugin": "^1.8.2",
"http-interop/http-factory-tests": "0.9.0",
"phpunit/phpunit": "^8.5.39 || ^9.6.20"
"phpunit/phpunit": "^8.5.44 || ^9.6.25"
},
"suggest": {
"laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
Expand Down
30 changes: 12 additions & 18 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ parameters:
path: src/Header.php

-
message: '#^Parameter \#2 \$character_mask of function trim expects string, mixed given\.$#'
message: '#^Parameter \#2 \$characters of function trim expects string, mixed given\.$#'
identifier: argument.type
count: 3
path: src/Header.php
Expand Down Expand Up @@ -277,7 +277,7 @@ parameters:
path: src/Message.php

-
message: '#^Parameter \#2 \$str of function explode expects string, mixed given\.$#'
message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#'
identifier: argument.type
count: 2
path: src/Message.php
Expand Down Expand Up @@ -397,21 +397,21 @@ parameters:
path: src/ServerRequest.php

-
message: '#^Parameter \#1 \$authority of static method GuzzleHttp\\Psr7\\ServerRequest\:\:extractHostAndPortFromAuthority\(\) expects string, mixed given\.$#'
message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ServerRequest.php

-
message: '#^Parameter \#1 \$host of method GuzzleHttp\\Psr7\\Uri\:\:withHost\(\) expects string, mixed given\.$#'
message: '#^Parameter \#1 \$authority of static method GuzzleHttp\\Psr7\\ServerRequest\:\:extractHostAndPortFromAuthority\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 3
count: 1
path: src/ServerRequest.php

-
message: '#^Parameter \#1 \$input of function array_keys expects array, mixed given\.$#'
message: '#^Parameter \#1 \$host of method GuzzleHttp\\Psr7\\Uri\:\:withHost\(\) expects string, mixed given\.$#'
identifier: argument.type
count: 1
count: 3
path: src/ServerRequest.php

-
Expand Down Expand Up @@ -439,7 +439,7 @@ parameters:
path: src/ServerRequest.php

-
message: '#^Parameter \#2 \$str of function explode expects string, mixed given\.$#'
message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/ServerRequest.php
Expand Down Expand Up @@ -559,7 +559,7 @@ parameters:
path: src/Uri.php

-
message: '#^Parameter \#1 \$str of function rawurlencode expects string, mixed given\.$#'
message: '#^Parameter \#1 \$string of function rawurlencode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Uri.php
Expand All @@ -577,13 +577,13 @@ parameters:
path: src/UriNormalizer.php

-
message: '#^Parameter \#1 \$str of function rawurldecode expects string, mixed given\.$#'
message: '#^Parameter \#1 \$string of function rawurldecode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/UriNormalizer.php

-
message: '#^Parameter \#1 \$str of function strtoupper expects string, mixed given\.$#'
message: '#^Parameter \#1 \$string of function strtoupper expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: src/UriNormalizer.php
Expand Down Expand Up @@ -649,13 +649,7 @@ parameters:
path: src/Utils.php

-
message: '#^PHPDoc tag @var with type object is not subtype of native type object\.$#'
identifier: varTag.nativeType
count: 1
path: src/Utils.php

-
message: '#^Parameter \#1 \$input of function array_keys expects array, mixed given\.$#'
message: '#^Parameter \#1 \$array of function array_keys expects array, mixed given\.$#'
identifier: argument.type
count: 1
path: src/Utils.php
Expand Down
111 changes: 89 additions & 22 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0">
<files psalm-version="6.13.1@1e3b7f0a8ab32b23197b91107adc0a7ed8a05b51">
<file src="src/BufferStream.php">
<FalsableReturnStatement>
<code><![CDATA[$result]]></code>
</FalsableReturnStatement>
<PossiblyFalsePropertyAssignmentValue>
<code><![CDATA[substr($this->buffer, $length)]]></code>
</PossiblyFalsePropertyAssignmentValue>
</file>
<file src="src/CachingStream.php">
<PossiblyFalseArgument>
<code><![CDATA[$remoteData]]></code>
</PossiblyFalseArgument>
<PossiblyFalseOperand>
<code><![CDATA[$remoteData]]></code>
</PossiblyFalseOperand>
</file>
<file src="src/DroppingStream.php">
<PossiblyFalseArgument>
<code><![CDATA[substr($string, 0, $diff)]]></code>
</PossiblyFalseArgument>
</file>
<file src="src/FnStream.php">
<InvalidFunctionCall>
<code><![CDATA[($this->_fn___toString)()]]></code>
<code><![CDATA[($this->_fn_close)()]]></code>
<code><![CDATA[($this->_fn_detach)()]]></code>
<code><![CDATA[($this->_fn_eof)()]]></code>
<code><![CDATA[($this->_fn_getContents)()]]></code>
<code><![CDATA[($this->_fn_getMetadata)($key)]]></code>
<code><![CDATA[($this->_fn_getSize)()]]></code>
<code><![CDATA[($this->_fn_isReadable)()]]></code>
<code><![CDATA[($this->_fn_isSeekable)()]]></code>
<code><![CDATA[($this->_fn_isWritable)()]]></code>
<code><![CDATA[($this->_fn_read)($length)]]></code>
<code><![CDATA[($this->_fn_rewind)()]]></code>
<code><![CDATA[($this->_fn_seek)($offset, $whence)]]></code>
<code><![CDATA[($this->_fn_tell)()]]></code>
<code><![CDATA[($this->_fn_write)($string)]]></code>
</InvalidFunctionCall>
<UndefinedThisPropertyFetch>
<code><![CDATA[$this->_fn___toString]]></code>
<code><![CDATA[$this->_fn_close]]></code>
<code><![CDATA[$this->_fn_close]]></code>
<code><![CDATA[$this->_fn_detach]]></code>
<code><![CDATA[$this->_fn_eof]]></code>
<code><![CDATA[$this->_fn_getContents]]></code>
<code><![CDATA[$this->_fn_getMetadata]]></code>
<code><![CDATA[$this->_fn_getSize]]></code>
<code><![CDATA[$this->_fn_isReadable]]></code>
<code><![CDATA[$this->_fn_isSeekable]]></code>
<code><![CDATA[$this->_fn_isWritable]]></code>
<code><![CDATA[$this->_fn_read]]></code>
<code><![CDATA[$this->_fn_rewind]]></code>
<code><![CDATA[$this->_fn_seek]]></code>
<code><![CDATA[$this->_fn_tell]]></code>
<code><![CDATA[$this->_fn_write]]></code>
</UndefinedThisPropertyFetch>
</file>
<file src="src/Header.php">
<PossiblyUndefinedArrayOffset>
Expand All @@ -30,10 +52,15 @@
</ParamNameMismatch>
</file>
<file src="src/Message.php">
<ImplicitToStringCast>
<code><![CDATA[$message->getBody()]]></code>
</ImplicitToStringCast>
<PossiblyNullArgument>
<code><![CDATA[$matches[1] === '/' ? self::parseRequestUri($parts[1], $data['headers']) : $parts[1]]]></code>
<code><![CDATA[$parts[1]]]></code>
<code><![CDATA[$parts[1]]]></code>
<code><![CDATA[$rawHeaders]]></code>
<code><![CDATA[$rawHeaders]]></code>
</PossiblyNullArgument>
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$parts[1]]]></code>
Expand Down Expand Up @@ -111,12 +138,51 @@
<code><![CDATA[isset($this->stream)]]></code>
</RedundantPropertyInitializationCheck>
</file>
<file src="src/StreamWrapper.php">
<FalsableReturnStatement>
<code><![CDATA[fopen('guzzle://stream', $mode, false, self::createStreamContext($stream))]]></code>
</FalsableReturnStatement>
</file>
<file src="src/Uri.php">
<InvalidNullableReturnType>
<code><![CDATA[string]]></code>
<code><![CDATA[string]]></code>
<code><![CDATA[string]]></code>
</InvalidNullableReturnType>
<NullableReturnStatement>
<code><![CDATA[preg_replace_callback(
'/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$component
)]]></code>
<code><![CDATA[preg_replace_callback(
'/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$str
)]]></code>
<code><![CDATA[preg_replace_callback(
'/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/',
[$this, 'rawurlencodeMatchZero'],
$path
)]]></code>
</NullableReturnStatement>
<PossiblyInvalidArgument>
<code><![CDATA[$result]]></code>
</PossiblyInvalidArgument>
</file>
<file src="src/UriNormalizer.php">
<PossiblyNullArgument>
<code><![CDATA[preg_replace('#//++#', '/', $uri->getPath())]]></code>
<code><![CDATA[preg_replace_callback($regex, $callback, $uri->getPath())]]></code>
<code><![CDATA[preg_replace_callback($regex, $callback, $uri->getPath())]]></code>
<code><![CDATA[preg_replace_callback($regex, $callback, $uri->getQuery())]]></code>
<code><![CDATA[preg_replace_callback($regex, $callback, $uri->getQuery())]]></code>
</PossiblyNullArgument>
</file>
<file src="src/UriResolver.php">
<PossiblyFalseOperand>
<code><![CDATA[substr($base->getPath(), 0, $lastSlashPos + 1)]]></code>
</PossiblyFalseOperand>
<TypeDoesNotContainType>
<code><![CDATA['' === $relativePath]]></code>
</TypeDoesNotContainType>
Expand All @@ -125,10 +191,11 @@
<FalsableReturnStatement>
<code><![CDATA[$contents]]></code>
</FalsableReturnStatement>
<MissingDocblockType>
<code><![CDATA[throw $ex;]]></code>
<code><![CDATA[throw $ex;]]></code>
</MissingDocblockType>
<PossiblyFalseArgument>
<code><![CDATA[$ctx]]></code>
<code><![CDATA[$ctx]]></code>
<code><![CDATA[\substr($userInfo, 0, $pos)]]></code>
</PossiblyFalseArgument>
<PossiblyUndefinedVariable>
<code><![CDATA[$contents]]></code>
<code><![CDATA[$handle]]></code>
Expand Down
4 changes: 4 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<directory name="vendor" />
</ignoreFiles>
</projectFiles>

<issueHandlers>
<MissingOverrideAttribute errorLevel="suppress" />
</issueHandlers>
</psalm>
Loading