Skip to content

Commit 3732a91

Browse files
committed
php 8.3
1 parent bc91031 commit 3732a91

File tree

10 files changed

+57
-71
lines changed

10 files changed

+57
-71
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-
php80:
10-
name: PHP 8.0
11-
runs-on: ubuntu-20.04
9+
php81:
10+
name: PHP 8.1
11+
runs-on: ubuntu-22.04
1212
steps:
1313
- name: checkout
1414
uses: actions/checkout@v3
1515
- name: composer test
16-
uses: docker://chubbyphp/ci-php80:latest
16+
uses: docker://chubbyphp/ci-php81:latest
1717
env:
1818
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1919
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
20-
php81:
21-
name: PHP 8.1
22-
runs-on: ubuntu-20.04
20+
php82:
21+
name: PHP 8.2
22+
runs-on: ubuntu-22.04
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v3
2626
- name: composer test
27-
uses: docker://chubbyphp/ci-php81:latest
27+
uses: docker://chubbyphp/ci-php82:latest
2828
env:
2929
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3030
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
31-
php82:
32-
name: PHP 8.2
33-
runs-on: ubuntu-20.04
31+
php83:
32+
name: PHP 8.3
33+
runs-on: ubuntu-22.04
3434
steps:
3535
- name: checkout
3636
uses: actions/checkout@v3
3737
- name: composer test
38-
uses: docker://chubbyphp/ci-php82:latest
38+
uses: docker://chubbyphp/ci-php83:latest
3939
env:
4040
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4141
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DS_Store
22
.idea/
3+
.phpunit.cache
34
.vscode/
45
build/
56
composer.lock
67
vendor/
7-
.phpunit.result.cache

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![CI](https://github.com/chubbyphp/chubbyphp-workerman-request-handler/workflows/CI/badge.svg?branch=master)](https://github.com/chubbyphp/chubbyphp-workerman-request-handler/actions?query=workflow%3ACI)
44
[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-workerman-request-handler/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-workerman-request-handler?branch=master)
5-
[![Infection MSI](https://badge.stryker-mutator.io/github.com/chubbyphp/chubbyphp-workerman-request-handler/master)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-workerman-request-handler/master)
5+
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyphp%2Fchubbyphp-workerman-request-handler%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-workerman-request-handler/master)[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-workerman-request-handler/v/stable.png)](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
66
[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-workerman-request-handler/v/stable.png)](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
77
[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-workerman-request-handler/downloads.png)](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
88
[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-workerman-request-handler/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-workerman-request-handler)
@@ -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.0
29-
* [psr/http-factory][2]: ^1.0.1
30-
* [psr/http-message][3]: ^1.0.1
31-
* [psr/http-server-handler][4]: ^1.0.1
32-
* [psr/log][5]: ^1.1.4|^2.0|^3.0
33-
* [workerman/workerman][6]: ^4.0.30
28+
* php: ^8.1
29+
* [psr/http-factory][2]: ^1.0.2
30+
* [psr/http-message][3]: ^1.1|^2.0
31+
* [psr/http-server-handler][4]: ^1.0.2
32+
* [psr/log][5]: ^2.0|^3.0
33+
* [workerman/workerman][6]: ^4.1.13
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.0"
40+
composer require chubbyphp/chubbyphp-workerman-request-handler "^2.1"
4141
```
4242

4343
## Usage

composer.json

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@
1717
}
1818
],
1919
"require": {
20-
"php": "^8.0",
21-
"psr/http-factory": "^1.0.1",
22-
"psr/http-message": "^1.0.1|^2.0",
23-
"psr/http-server-handler": "^1.0.1",
24-
"psr/log": "^1.1.4|^2.0|^3.0",
25-
"workerman/workerman": "^4.0.30"
20+
"php": "^8.1",
21+
"psr/http-factory": "^1.0.2",
22+
"psr/http-message": "^1.1|^2.0",
23+
"psr/http-server-handler": "^1.0.2",
24+
"psr/log": "^2.0|^3.0",
25+
"workerman/workerman": "^4.1.13"
2626
},
2727
"require-dev": {
28-
"blackfire/php-sdk": "^1.29",
28+
"blackfire/php-sdk": "^2.3.5",
2929
"chubbyphp/chubbyphp-dev-helper": "dev-master",
30-
"chubbyphp/chubbyphp-mock": "^1.6.1",
31-
"infection/infection": "^0.26.5",
32-
"php-coveralls/php-coveralls": "^2.5.2",
33-
"phploc/phploc": "^7.0.2",
34-
"phpstan/extension-installer": "^1.1",
35-
"phpstan/phpstan": "^1.4.8",
36-
"phpunit/phpunit": "^9.5.17"
30+
"chubbyphp/chubbyphp-mock": "^1.7",
31+
"infection/infection": "^0.27.8",
32+
"php-coveralls/php-coveralls": "^2.7",
33+
"phpstan/extension-installer": "^1.3.1",
34+
"phpstan/phpstan": "^1.10.45",
35+
"phpunit/phpunit": "^10.4.2"
3736
},
3837
"autoload": {
3938
"psr-4": { "Chubbyphp\\WorkermanRequestHandler\\": "src/" }
@@ -50,7 +49,7 @@
5049
},
5150
"extra": {
5251
"branch-alias": {
53-
"dev-master": "2.0-dev"
52+
"dev-master": "2.1-dev"
5453
}
5554
},
5655
"scripts": {
@@ -61,14 +60,12 @@
6160
"@test:integration",
6261
"@test:infection",
6362
"@test:static-analysis",
64-
"@test:loc",
6563
"@test:cs"
6664
],
6765
"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",
6866
"test:infection": "vendor/bin/infection --threads=$(nproc) --min-msi=100 --verbose --coverage=build/phpunit",
6967
"test:integration": "vendor/bin/phpunit --testsuite=Integration --cache-result-file=build/phpunit/result.cache",
7068
"test:lint": "mkdir -p build && find src tests -name '*.php' -print0 | xargs -0 -n1 -P$(nproc) php -l | tee build/phplint.log",
71-
"test:loc": "mkdir -p build && vendor/bin/phploc src | tee build/phploc.log",
7269
"test:static-analysis": "mkdir -p build && bash -c 'vendor/bin/phpstan analyse src --no-progress --level=7 --error-format=junit | tee build/phpstan.junit.xml; if [ ${PIPESTATUS[0]} -ne \"0\" ]; then exit 1; fi'",
7370
"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"
7471
}

phpunit.xml

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
executionOrder="random"
10-
processIsolation="false"
11-
stopOnFailure="false"
12-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
13-
<coverage>
14-
<include>
15-
<directory>./src</directory>
16-
</include>
17-
</coverage>
18-
<testsuites>
19-
<testsuite name="Integration">
20-
<directory>./tests/Integration</directory>
21-
</testsuite>
22-
<testsuite name="Unit">
23-
<directory>./tests/Unit</directory>
24-
</testsuite>
25-
</testsuites>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" executionOrder="random" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
3+
<coverage/>
4+
<testsuites>
5+
<testsuite name="Integration">
6+
<directory>./tests/Integration</directory>
7+
</testsuite>
8+
<testsuite name="Unit">
9+
<directory>./tests/Unit</directory>
10+
</testsuite>
11+
</testsuites>
12+
<source>
13+
<include>
14+
<directory>./src</directory>
15+
</include>
16+
</source>
2617
</phpunit>

src/Adapter/NewRelicOnMessageAdapter.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010

1111
final class NewRelicOnMessageAdapter implements OnMessageInterface
1212
{
13-
public function __construct(private OnMessageInterface $onRequest, private string $appname)
14-
{
15-
}
13+
public function __construct(private OnMessageInterface $onRequest, private string $appname) {}
1614

1715
public function __invoke(WorkermanTcpConnection $workermanTcpConnection, WorkermanRequest $workermanRequest): void
1816
{

src/OnMessage.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ public function __construct(
1414
private PsrRequestFactoryInterface $psrRequestFactory,
1515
private WorkermanResponseEmitterInterface $workermanResponseEmitter,
1616
private RequestHandlerInterface $requestHander
17-
) {
18-
}
17+
) {}
1918

2019
public function __invoke(WorkermanTcpConnection $workermanTcpConnection, WorkermanRequest $workermanRequest): void
2120
{

src/PsrRequestFactory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ public function __construct(
1818
private ServerRequestFactoryInterface $serverRequestFactory,
1919
private StreamFactoryInterface $streamFactory,
2020
private UploadedFileFactoryInterface $uploadedFileFactory
21-
) {
22-
}
21+
) {}
2322

2423
public function create(WorkermanTcpConnection $workermanTcpConnection, WorkermanRequest $workermanRequest): ServerRequestInterface
2524
{

tests/Unit/Adapter/NewRelicOnMessageAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function newrelic_end_transaction(bool $ignore = false): void
8585
*
8686
* @internal
8787
*/
88-
final class NewRelicRouteMiddlewareTest extends TestCase
88+
final class NewRelicOnMessageAdapterTest extends TestCase
8989
{
9090
use MockByCallsTrait;
9191

tests/Unit/PsrRequestFactoryTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ final class PsrRequestFactoryTest extends TestCase
3030

3131
public function testInvoke(): void
3232
{
33+
$bodyString = 'This is the body.';
34+
3335
/** @var MockObject|WorkermanRequest $workermanRequest */
3436
$workermanRequest = $this->getMockByCalls(WorkermanRequest::class, [
3537
Call::create('method')->with()->willReturn('POST'),
@@ -79,7 +81,7 @@ public function testInvoke(): void
7981

8082
/** @var MockObject|StreamInterface $requestBody */
8183
$requestBody = $this->getMockByCalls(StreamInterface::class, [
82-
Call::create('write')->with('This is the body.'),
84+
Call::create('write')->with($bodyString)->willReturn(\strlen($bodyString)),
8385
]);
8486

8587
/** @var MockObject|StreamInterface $uploadedFileStream1 */

0 commit comments

Comments
 (0)