Skip to content

Commit 1abb73f

Browse files
author
Dominik Zogg
committed
php 8.4 and phpunit 11
1 parent 62e7fa9 commit 1abb73f

File tree

6 files changed

+43
-39
lines changed

6 files changed

+43
-39
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,36 @@ on:
66
- cron: '0 0 * * *'
77

88
jobs:
9-
php81:
10-
name: PHP 8.1
11-
runs-on: ubuntu-22.04
9+
php82:
10+
name: PHP 8.2
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- name: checkout
1414
uses: actions/checkout@v4
1515
- name: composer test
16-
uses: docker://ghcr.io/chubbyphp/ci-php81:latest
16+
uses: docker://ghcr.io/chubbyphp/ci-php82:latest
1717
env:
1818
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
20-
php82:
21-
name: PHP 8.2
22-
runs-on: ubuntu-22.04
20+
php83:
21+
name: PHP 8.3
22+
runs-on: ubuntu-24.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v4
2626
- name: composer test
27-
uses: docker://ghcr.io/chubbyphp/ci-php82:latest
27+
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
2828
env:
2929
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
31-
php83:
32-
name: PHP 8.3
33-
runs-on: ubuntu-22.04
31+
php84:
32+
name: PHP 8.4
33+
runs-on: ubuntu-24.04
3434
steps:
3535
- name: checkout
3636
uses: actions/checkout@v4
3737
- name: composer test
38-
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
38+
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
3939
env:
4040
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ A request handler adapter for swoole, using PSR-7, PSR-15 and PSR-17.
2525

2626
## Requirements
2727

28-
* php: ^8.1
29-
* [ext-swoole][2]: ^5.1.1
28+
* php: ^8.2
29+
* [ext-swoole][2]: ^5.1.6|6.0.0-RC1|^6.0
3030
* [dflydev/fig-cookies][3]: ^3.1
31-
* [psr/http-factory][4]: ^1.0.2
31+
* [psr/http-factory][4]: ^1.1
3232
* [psr/http-message][5]: ^1.1|^2.0
3333
* [psr/http-server-handler][6]: ^1.0.2
34-
* [psr/log][7]: ^2.0|^3.0
34+
* [psr/log][7]: ^2.0|^3.0.2
3535

3636
## Installation
3737

3838
Through [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-swoole-request-handler][1].
3939

4040
```sh
41-
composer require chubbyphp/chubbyphp-swoole-request-handler "^1.3"
41+
composer require chubbyphp/chubbyphp-swoole-request-handler "^1.5"
4242
```
4343

4444
## Usage

composer.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.1",
21-
"ext-swoole": "^5.1.1",
20+
"php": "^8.2",
21+
"ext-swoole": "^5.1.6|6.0.0-RC1|^6.0",
2222
"dflydev/fig-cookies": "^3.1",
23-
"psr/http-factory": "^1.0.2",
23+
"psr/http-factory": "^1.1",
2424
"psr/http-message": "^1.1|^2.0",
2525
"psr/http-server-handler": "^1.0.2",
26-
"psr/log": "^2.0|^3.0"
26+
"psr/log": "^2.0|^3.0.2"
2727
},
2828
"require-dev": {
29-
"blackfire/php-sdk": "^2.3.5",
29+
"blackfire/php-sdk": "^2.5.4",
3030
"chubbyphp/chubbyphp-dev-helper": "dev-master",
31-
"chubbyphp/chubbyphp-mock": "^1.7",
32-
"infection/infection": "^0.27.8",
31+
"chubbyphp/chubbyphp-mock": "^1.8",
32+
"infection/infection": "^0.29.8",
3333
"php-coveralls/php-coveralls": "^2.7",
34-
"phpstan/extension-installer": "^1.3.1",
35-
"phpstan/phpstan": "^1.10.45",
36-
"phpunit/phpunit": "^10.4.2",
37-
"swoole/ide-helper": "^5.1"
34+
"phpstan/extension-installer": "^1.4.3",
35+
"phpstan/phpstan": "^2.0.3",
36+
"phpunit/phpunit": "^11.5.0",
37+
"swoole/ide-helper": "^5.1.6|^6.0.0-RC1|^6.0"
3838
},
3939
"autoload": {
4040
"psr-4": {
@@ -55,7 +55,7 @@
5555
},
5656
"extra": {
5757
"branch-alias": {
58-
"dev-master": "1.4-dev"
58+
"dev-master": "1.5-dev"
5959
}
6060
},
6161
"scripts": {
@@ -69,10 +69,10 @@
6969
"@test:cs"
7070
],
7171
"test:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
72-
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
73-
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-result-file=build/phpunit/result.cache",
72+
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=96 --verbose --coverage=build/phpunit",
73+
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-directory=build/phpunit",
7474
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
7575
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=8 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
76-
"test:unit": "vendor/bin/phpunit --testsuite=Unit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-result-file=build/phpunit/result.cache"
76+
"test:unit": "vendor/bin/phpunit --testsuite=Unit --coverage-text --coverage-clover=build/phpunit/clover.xml --coverage-html=build/phpunit/coverage-html --coverage-xml=build/phpunit/coverage-xml --log-junit=build/phpunit/junit.xml --cache-directory=build/phpunit"
7777
}
7878
}

src/Adapter/BlackfireOnRequestAdapter.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
namespace Chubbyphp\SwooleRequestHandler\Adapter;
66

77
use Blackfire\Client;
8-
use Blackfire\Exception\ExceptionInterface;
8+
use Blackfire\Exception\LogicException;
9+
use Blackfire\Exception\RuntimeException;
910
use Blackfire\Probe;
1011
use Blackfire\Profile\Configuration;
1112
use Chubbyphp\SwooleRequestHandler\OnRequestInterface;
@@ -53,8 +54,8 @@ private function startProbe(): ?Probe
5354
{
5455
try {
5556
return $this->client->createProbe($this->config);
56-
} catch (ExceptionInterface $exception) {
57-
$this->logger->error(sprintf('Blackfire exception: %s', $exception->getMessage()));
57+
} catch (LogicException|RuntimeException $exception) {
58+
$this->logger->error(\sprintf('Blackfire exception: %s', $exception->getMessage()));
5859
}
5960

6061
return null;
@@ -64,8 +65,8 @@ private function endProbe(Probe $probe): void
6465
{
6566
try {
6667
$this->client->endProbe($probe);
67-
} catch (ExceptionInterface $exception) {
68-
$this->logger->error(sprintf('Blackfire exception: %s', $exception->getMessage()));
68+
} catch (LogicException|RuntimeException $exception) {
69+
$this->logger->error(\sprintf('Blackfire exception: %s', $exception->getMessage()));
6970
}
7071
}
7172
}

src/SwooleResponseEmitter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public function emit(ResponseInterface $response, SwooleResponse $swooleResponse
1515
{
1616
$swooleResponse->status($response->getStatusCode(), $response->getReasonPhrase());
1717

18+
/** @var string $name */
1819
foreach ($response->withoutHeader(SetCookies::SET_COOKIE_HEADER)->getHeaders() as $name => $values) {
1920
$swooleResponse->header($name, implode(', ', $values));
2021
}

tests/Unit/SwooleResponseEmitterTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public function testInvoke(): void
6363
true,
6464
true,
6565
'Strict',
66-
''
66+
'',
67+
false
6768
)
6869
->willReturn(true),
6970
Call::create('write')->with('This is the body.')->willReturn(true),
@@ -115,7 +116,8 @@ public function testInvokeWithEmptyBody(): void
115116
true,
116117
true,
117118
'',
118-
''
119+
'',
120+
false,
119121
)->willReturn(true),
120122
Call::create('end')->with(null)->willReturn(true),
121123
]);

0 commit comments

Comments
 (0)