Skip to content

Commit fd82f21

Browse files
authored
Merge pull request #26 from php-http/sf8
allow sf8 and test with php 8.5
2 parents 11862cf + e0e641c commit fd82f21

File tree

5 files changed

+30
-27
lines changed

5 files changed

+30
-27
lines changed

.github/workflows/static.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Static analysis
33
on:
44
push:
55
branches:
6-
- master
6+
- '[0-9]+.x'
7+
- '[0-9]+.[0-9]+'
8+
- '[0-9]+.[0-9]+.x'
79
pull_request:
810

911
jobs:
@@ -13,7 +15,7 @@ jobs:
1315

1416
steps:
1517
- name: Checkout code
16-
uses: actions/checkout@v2
18+
uses: actions/checkout@v6
1719

1820
- name: PHPStan
1921
uses: docker://oskarstark/phpstan-ga

.github/workflows/tests.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: tests
33
on:
44
push:
55
branches:
6-
- master
6+
- '[0-9]+.x'
7+
- '[0-9]+.[0-9]+'
8+
- '[0-9]+.[0-9]+.x'
79
pull_request:
810

911
jobs:
@@ -13,23 +15,22 @@ jobs:
1315
strategy:
1416
fail-fast: false
1517
matrix:
16-
php: ['7.3', '7.4', '8.0', '8.2']
18+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1719
symfony-version: ['*']
1820
include:
19-
- php: '7.4'
20-
symfony-version: 3.4.*
21-
- php: '7.4'
22-
symfony-version: 4.4.*
23-
- php: '8.0'
21+
- php: '8.1'
2422
symfony-version: 5.4.*
25-
- php: '8.0'
23+
- php: '8.1'
2624
symfony-version: 6.0.*
2725
- php: '8.2'
2826
symfony-version: 7.0.*
27+
- php: '8.5'
28+
symfony-version: 8.0.*
29+
2930

3031
steps:
3132
- name: Checkout code
32-
uses: actions/checkout@v2
33+
uses: actions/checkout@v6
3334

3435
- name: Setup PHP
3536
uses: shivammathur/setup-php@v2
@@ -59,7 +60,7 @@ jobs:
5960
runs-on: ubuntu-latest
6061
strategy:
6162
matrix:
62-
php: ['7.3']
63+
php: ['8.1']
6364

6465
steps:
6566
- name: Checkout code
@@ -89,7 +90,7 @@ jobs:
8990
- name: Setup PHP
9091
uses: shivammathur/setup-php@v2
9192
with:
92-
php-version: 7.4
93+
php-version: "8.5"
9394
tools: composer:v2
9495
coverage: xdebug
9596

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## 1.5.0
4+
5+
- Support Symfony 8
6+
- Test with PHP 8.5
7+
- Remove support for PHP < 8.1
8+
39
## 1.4.2 - 2023-12-05
410

511
- Support Symfony 7

composer.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.3 || ^8.0",
15-
"symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0",
14+
"php": "^8.1",
15+
"symfony/stopwatch": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0",
1616
"php-http/client-common": "^1.9 || ^2.0"
1717
},
1818
"require-dev": {
@@ -32,16 +32,9 @@
3232
"scripts": {
3333
"test": "vendor/bin/simple-phpunit"
3434
},
35-
"extra": {
36-
"branch-alias": {
37-
"dev-master": "1.3-dev"
38-
}
39-
},
4035
"config": {
4136
"allow-plugins": {
4237
"symfony/flex": true
4338
}
44-
},
45-
"prefer-stable": true,
46-
"minimum-stability": "dev"
39+
}
4740
}

src/StopwatchPlugin.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ public function __construct(Stopwatch $stopwatch)
3131
}
3232

3333
/**
34+
* @param callable(RequestInterface): Promise $next Next middleware in the chain, the request is passed as the first argument
35+
* @param callable(RequestInterface): Promise $first First middleware in the chain, used to restart a request
36+
*
3437
* @return Promise Resolves a PSR-7 Response or fails with an Http\Client\Exception (The same as HttpAsyncClient)
3538
*/
36-
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
39+
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first): Promise
3740
{
3841
$eventName = $this->getStopwatchEventName($request);
3942
$this->stopwatch->start($eventName, self::CATEGORY);
@@ -51,10 +54,8 @@ protected function doHandleRequest(RequestInterface $request, callable $next, ca
5154

5255
/**
5356
* Generates the event name.
54-
*
55-
* @return string
5657
*/
57-
private function getStopwatchEventName(RequestInterface $request)
58+
private function getStopwatchEventName(RequestInterface $request): string
5859
{
5960
return sprintf('%s %s', $request->getMethod(), $request->getUri()->__toString());
6061
}

0 commit comments

Comments
 (0)