Skip to content

Commit 0ba6716

Browse files
author
Dominik Zogg
committed
php 8.1
1 parent 083d480 commit 0ba6716

File tree

5 files changed

+27
-22
lines changed

5 files changed

+27
-22
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@ jobs:
4141
env:
4242
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4343
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
44+
php81:
45+
name: PHP 8.1
46+
runs-on: ubuntu-20.04
47+
steps:
48+
- name: checkout
49+
uses: actions/checkout@v2
50+
- name: composer test
51+
uses: docker://chubbyphp/ci-php81:latest
52+
env:
53+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
4455
- name: sonarcloud.io
4556
uses: sonarsource/sonarcloud-github-action@master
4657
env:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A request handler adapter for workerman, using PSR-7, PSR-15 and PSR-17.
3030
* [psr/http-message][3]: ^1.0.1
3131
* [psr/http-server-handler][4]: ^1.0.1
3232
* [psr/log][5]: ^1.1.4
33-
* [workerman/workerman][6]: ^4.0.6
33+
* [workerman/workerman][6]: ^4.0.24
3434

3535
## Installation
3636

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
"psr/http-message": "^1.0.1",
2323
"psr/http-server-handler": "^1.0.1",
2424
"psr/log": "^1.1.4",
25-
"workerman/workerman": "^4.0.6"
25+
"workerman/workerman": "^4.0.24"
2626
},
2727
"require-dev": {
2828
"blackfire/php-sdk": "^1.23",
2929
"chubbyphp/chubbyphp-dev-helper": "dev-master",
30-
"chubbyphp/chubbyphp-mock": "^1.6",
31-
"infection/infection": "^0.25.2",
32-
"php-coveralls/php-coveralls": "^2.4.3",
30+
"chubbyphp/chubbyphp-mock": "^1.6.1",
31+
"infection/infection": "^0.25.3",
32+
"php-coveralls/php-coveralls": "^2.5.1",
3333
"phploc/phploc": "^7.0.2",
3434
"phpstan/extension-installer": "^1.1",
35-
"phpstan/phpstan": "^0.12.99",
35+
"phpstan/phpstan": "^1.1.2",
3636
"phpunit/phpunit": "^9.5.10"
3737
},
3838
"autoload": {
@@ -50,7 +50,7 @@
5050
}
5151
},
5252
"scripts": {
53-
"fix:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
53+
"fix:cs": "mkdir -p build && PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix --cache-file=build/phpcs.cache",
5454
"test": [
5555
"@test:lint",
5656
"@test:unit",
@@ -60,7 +60,7 @@
6060
"@test:loc",
6161
"@test:cs"
6262
],
63-
"test:cs": "mkdir -p build && vendor/bin/php-cs-fixer fix --dry-run --stop-on-violation --cache-file=build/phpcs.cache",
63+
"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",
6464
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
6565
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-result-file=build/phpunit/result.cache",
6666
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",

phpstan.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '/Parameter \#1 \$name of method Workerman\\Protocols\\Http\\Request\:\:header\(\) expects null, string given\./'
5-
path: %currentWorkingDirectory%/src/Adapter/BlackfireOnMessageAdapter.php
6-
-
7-
message: '/Argument of an invalid type string supplied for foreach, only iterables are supported\./'
8-
path: %currentWorkingDirectory%/src/PsrRequestFactory.php
9-
-
10-
message: '/Parameter \#1 \$cookies of method Psr\\Http\\Message\\ServerRequestInterface\:\:withCookieParams\(\) expects array, string\|null given\./'
11-
path: %currentWorkingDirectory%/src/PsrRequestFactory.php
123
-
134
message: '/uploadedFiles/'
145
path: %currentWorkingDirectory%/src/PsrRequestFactory.php
@@ -18,6 +9,3 @@ parameters:
189
-
1910
message: '/createUploadedFile/'
2011
path: %currentWorkingDirectory%/src/PsrRequestFactory.php
21-
-
22-
message: '/Parameter \#2 \$reason_phrase of method Workerman\\Protocols\\Http\\Response\:\:withStatus\(\) expects null, string given\./'
23-
path: %currentWorkingDirectory%/src/WorkermanResponseEmitter.php

src/PsrRequestFactory.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ public function create(WorkermanRequest $workermanRequest): ServerRequestInterfa
3636
$workermanRequest->uri()
3737
);
3838

39-
foreach ($workermanRequest->header() as $name => $value) {
39+
/** @var array<string, string> $headers */
40+
$headers = $workermanRequest->header();
41+
42+
foreach ($headers as $name => $value) {
4043
$request = $request->withHeader($name, $value);
4144
}
4245

43-
$request = $request->withCookieParams($workermanRequest->cookie());
46+
/** @var array<string, string> $cookies */
47+
$cookies = $workermanRequest->cookie();
48+
49+
$request = $request->withCookieParams($cookies);
4450
$request = $request->withQueryParams($workermanRequest->get());
4551
$request = $request->withParsedBody($workermanRequest->post());
4652
$request = $request->withUploadedFiles($this->uploadedFiles($workermanRequest->file()));

0 commit comments

Comments
 (0)