Skip to content

Commit 4b00d49

Browse files
committed
test with php 8.5
1 parent 4ecf21e commit 4b00d49

File tree

6 files changed

+14
-15
lines changed

6 files changed

+14
-15
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
15+
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
1616

1717
steps:
1818
- name: Checkout code
19-
uses: actions/checkout@v4
20-
21-
- name: Emulate PHP 8.3
22-
run: composer config platform.php 8.3.999
23-
if: matrix.php == '8.4'
19+
uses: actions/checkout@v6
2420

2521
- name: Setup PHP
2622
uses: shivammathur/setup-php@v2
@@ -41,7 +37,7 @@ jobs:
4137

4238
steps:
4339
- name: Checkout code
44-
uses: actions/checkout@v4
40+
uses: actions/checkout@v6
4541

4642
- name: Setup PHP
4743
uses: shivammathur/setup-php@v2
@@ -69,7 +65,7 @@ jobs:
6965

7066
steps:
7167
- name: Checkout code
72-
uses: actions/checkout@v4
68+
uses: actions/checkout@v6
7369

7470
- name: Setup PHP
7571
uses: shivammathur/setup-php@v2
@@ -92,7 +88,7 @@ jobs:
9288

9389
steps:
9490
- name: Checkout code
95-
uses: actions/checkout@v4
91+
uses: actions/checkout@v6
9692

9793
- name: Setup PHP
9894
uses: shivammathur/setup-php@v2

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ parameters:
105105
count: 1
106106
path: src/CookieJar.php
107107

108-
-
109-
message: "#^Property Http\\\\Message\\\\CookieUtil\\:\\:\\$dateFormats type has no value type specified in iterable type array\\.$#"
110-
count: 1
111-
path: src/CookieUtil.php
112-
113108
-
114109
message: "#^Method Http\\\\Message\\\\MessageFactory\\\\DiactorosMessageFactory\\:\\:createRequest\\(\\) has parameter \\$headers with no value type specified in iterable type array\\.$#"
115110
count: 1

phpstan.neon.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ includes:
22
- phpstan-baseline.neon
33

44
parameters:
5+
treatPhpDocTypesAsCertain: false
56
level: max
67
paths:
78
- src

src/CookieUtil.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ final class CookieUtil
1010
* Handles dates as defined by RFC 2616 section 3.3.1, and also some other
1111
* non-standard, but common formats.
1212
*
13-
* @var array
13+
* @var string[]
1414
*/
1515
private static $dateFormats = [
1616
'D, d M y H:i:s T',
@@ -34,6 +34,9 @@ final class CookieUtil
3434
*/
3535
public static function parseDate($dateValue)
3636
{
37+
if (!is_string($dateValue)) {
38+
throw new \InvalidArgumentException('Date must be of type string, given '.gettype($dateValue));
39+
}
3740
foreach (self::$dateFormats as $dateFormat) {
3841
if (false !== $date = \DateTime::createFromFormat($dateFormat, $dateValue, new \DateTimeZone('GMT'))) {
3942
return $date;

src/Encoding/Filter/Chunk.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ class Chunk extends \php_user_filter
1212
public function filter($in, $out, &$consumed, $closing): int
1313
{
1414
while ($bucket = stream_bucket_make_writeable($in)) {
15+
/* @phpstan-ignore argument.type */
1516
$lenbucket = stream_bucket_new($this->stream, dechex($bucket->datalen)."\r\n");
1617
stream_bucket_append($out, $lenbucket);
1718

1819
$consumed += $bucket->datalen;
1920
stream_bucket_append($out, $bucket);
2021

22+
/* @phpstan-ignore argument.type */
2123
$lenbucket = stream_bucket_new($this->stream, "\r\n");
2224
stream_bucket_append($out, $lenbucket);
2325
}

src/Encoding/FilteredStream.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ public function eof(): bool
113113
protected function fill(): void
114114
{
115115
$readFilterCallback = $this->readFilterCallback;
116+
/* @phpstan-ignore assignOp.invalid */
116117
$this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE));
117118

118119
if ($this->stream->eof()) {
120+
/* @phpstan-ignore assignOp.invalid */
119121
$this->buffer .= $readFilterCallback();
120122
}
121123
}

0 commit comments

Comments
 (0)