Skip to content

Commit 711638c

Browse files
committed
php85 / workerman/workerman 5.x
1 parent b434adc commit 711638c

File tree

6 files changed

+31
-37
lines changed

6 files changed

+31
-37
lines changed

.github/workflows/ci.yml

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

88
jobs:
9-
php82:
10-
name: PHP 8.2
9+
php83:
10+
name: PHP 8.3
1111
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-php82:latest
16+
uses: docker://ghcr.io/chubbyphp/ci-php83:latest
1717
env:
1818
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
20-
php83:
21-
name: PHP 8.3
20+
php84:
21+
name: PHP 8.4
2222
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-php83:latest
27+
uses: docker://ghcr.io/chubbyphp/ci-php84:latest
2828
env:
2929
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
31-
php84:
32-
name: PHP 8.4
31+
php85:
32+
name: PHP 8.5
3333
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-php84:latest
38+
uses: docker://ghcr.io/chubbyphp/ci-php85:latest
3939
env:
4040
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
$config = require __DIR__ . '/vendor/chubbyphp/chubbyphp-dev-helper/phpcs.php';
1414

1515
return (new PhpCsFixer\Config)
16+
->setUnsupportedPhpVersionAllowed(true)
1617
->setIndent($config['indent'])
1718
->setLineEnding($config['lineEnding'])
1819
->setRules($config['rules'])

README.md

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

2626
## Requirements
2727

28-
* php: ^8.2
28+
* php: ^8.3
2929
* [psr/http-factory][2]: ^1.1
3030
* [psr/http-message][3]: ^1.1|^2.0
3131
* [psr/http-server-handler][4]: ^1.0.2
3232
* [psr/log][5]: ^2.0|^3.0.2
33-
* [workerman/workerman][6]: ^4.2.1
33+
* [workerman/workerman][6]: ^5.1.6
3434

3535
## Installation
3636

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

3939
```sh
40-
composer require chubbyphp/chubbyphp-workerman-request-handler "^2.2"
40+
composer require chubbyphp/chubbyphp-workerman-request-handler "^2.3"
4141
```
4242

4343
## Usage

composer.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,22 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.2",
20+
"php": "^8.3",
2121
"psr/http-factory": "^1.1",
2222
"psr/http-message": "^1.1|^2.0",
2323
"psr/http-server-handler": "^1.0.2",
2424
"psr/log": "^2.0|^3.0.2",
25-
"workerman/workerman": "^4.2.1"
25+
"workerman/workerman": "^5.1.6"
2626
},
2727
"require-dev": {
28-
"blackfire/php-sdk": "^2.5.7",
28+
"blackfire/php-sdk": "^2.5.10",
2929
"chubbyphp/chubbyphp-dev-helper": "dev-master",
30-
"chubbyphp/chubbyphp-mock": "^2.0",
31-
"infection/infection": "^0.29.12",
32-
"php-coveralls/php-coveralls": "^2.7",
30+
"chubbyphp/chubbyphp-mock": "^2.0.1",
31+
"infection/infection": "^0.31.9",
32+
"php-coveralls/php-coveralls": "^2.9",
3333
"phpstan/extension-installer": "^1.4.3",
34-
"phpstan/phpstan": "^2.1.6",
35-
"phpunit/phpunit": "^11.5.9"
34+
"phpstan/phpstan": "^2.1.32",
35+
"phpunit/phpunit": "^12.4.5"
3636
},
3737
"autoload": {
3838
"psr-4": { "Chubbyphp\\WorkermanRequestHandler\\": "src/" }
@@ -49,11 +49,11 @@
4949
},
5050
"extra": {
5151
"branch-alias": {
52-
"dev-master": "2.2-dev"
52+
"dev-master": "2.3-dev"
5353
}
5454
},
5555
"scripts": {
56-
"fix:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
56+
"fix:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
5757
"test": [
5858
"@test:lint",
5959
"@test:unit",
@@ -62,7 +62,7 @@
6262
"@test:static-analysis",
6363
"@test:cs"
6464
],
65-
"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",
65+
"test:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
6666
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
6767
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-directory=build/phpunit",
6868
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",

src/Adapter/BlackfireOnMessageAdapter.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,12 @@
1616

1717
final class BlackfireOnMessageAdapter implements OnMessageInterface
1818
{
19-
private Configuration $config;
20-
21-
private LoggerInterface $logger;
22-
2319
public function __construct(
2420
private OnMessageInterface $onRequest,
2521
private Client $client,
26-
?Configuration $config = null,
27-
?LoggerInterface $logger = null
28-
) {
29-
$this->config = $config ?? new Configuration();
30-
$this->logger = $logger ?? new NullLogger();
31-
}
22+
private Configuration $config = new Configuration(),
23+
private LoggerInterface $logger = new NullLogger()
24+
) {}
3225

3326
public function __invoke(WorkermanTcpConnection $workermanTcpConnection, WorkermanRequest $workermanRequest): void
3427
{

tests/Unit/WorkermanResponseEmitterTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public function testInvoke(): void
4646
/** @var WorkermanTcpConnection $workermanTcpConnection */
4747
$workermanTcpConnection = $builder->create(WorkermanTcpConnection::class, [
4848
new WithCallback('send', static function (WorkermanResponse $workermanResponse, $flag) use ($headers): void {
49-
self::assertSame(200, self::getWorkermanResponseProperty($workermanResponse, '_status'));
50-
self::assertSame('OK', self::getWorkermanResponseProperty($workermanResponse, '_reason'));
51-
self::assertSame($headers, self::getWorkermanResponseProperty($workermanResponse, '_header'));
52-
self::assertSame('This is the body.', self::getWorkermanResponseProperty($workermanResponse, '_body'));
49+
self::assertSame(200, self::getWorkermanResponseProperty($workermanResponse, 'status'));
50+
self::assertSame('OK', self::getWorkermanResponseProperty($workermanResponse, 'reason'));
51+
self::assertSame($headers, self::getWorkermanResponseProperty($workermanResponse, 'headers'));
52+
self::assertSame('This is the body.', self::getWorkermanResponseProperty($workermanResponse, 'body'));
5353
self::assertFalse($flag);
5454
}),
5555
]);

0 commit comments

Comments
 (0)