Skip to content

Commit 2f1b6d1

Browse files
authored
Add PHP 8.4 to CI (#87)
1 parent e7fc183 commit 2f1b6d1

File tree

14 files changed

+44
-26
lines changed

14 files changed

+44
-26
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ jobs:
3131
os: >-
3232
['ubuntu-latest', 'windows-latest']
3333
php: >-
34-
['8.1', '8.2', '8.3']
34+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/composer-require-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
os: >-
3333
['ubuntu-latest']
3434
php: >-
35-
['8.1', '8.2', '8.3']
35+
['8.1', '8.2', '8.3', '8.4']

.github/workflows/mutation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
os: >-
2929
['ubuntu-latest']
3030
php: >-
31-
['8.3']
31+
['8.4']
3232
secrets:
3333
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/rector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ jobs:
2121
os: >-
2222
['ubuntu-latest']
2323
php: >-
24-
['8.3']
24+
['8.4']

.github/workflows/static.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929
os: >-
3030
['ubuntu-latest']
3131
php: >-
32-
['8.1', '8.2', '8.3']
32+
['8.1', '8.2', '8.3', '8.4']

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
- Chg #85: Add `$temporaryErrorHandler` parameter to `HttpApplicationRunner` constructor. Mark parameter `$logger` and
66
method `withTemporaryErrorHandler()` as deprecated (@vjik)
77
- Enh #86: Raise the minimum PHP version to 8.1 and minor refactoring (@vjik)
8+
- Chg #87: Change PHP constraint in `composer.json` to `~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0` (@vjik)
9+
- Bug #87: Explicitly mark nullable parameters (@vjik)
810

911
## 3.0.0 July 16, 2024
1012

composer.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@
2828
}
2929
],
3030
"require": {
31-
"php": "^8.1",
31+
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
3232
"psr/http-factory": "^1.0",
33-
"psr/http-message": "^1.0|^2.0",
33+
"psr/http-message": "^1.0 || ^2.0",
3434
"psr/log": "^3.0",
3535
"yiisoft/config": "^1.1",
36-
"yiisoft/definitions": "^1.0|^2.0|^3.0",
36+
"yiisoft/definitions": "^1.0 || ^2.0 || ^3.0",
3737
"yiisoft/di": "^1.0",
38-
"yiisoft/error-handler": "^3.0",
38+
"yiisoft/error-handler": "^4.0",
3939
"yiisoft/friendly-exception": "^1.1",
4040
"yiisoft/http": "^1.2",
4141
"yiisoft/yii-http": "^1.0",
4242
"yiisoft/yii-runner": "^2.2"
4343
},
4444
"require-dev": {
45+
"bamarni/composer-bin-plugin": "^1.8.2",
4546
"httpsoft/http-message": "^1.1.6",
46-
"maglnet/composer-require-checker": "^4.7.1",
47-
"phpunit/phpunit": "^10.5.44",
48-
"rector/rector": "^2.0.7",
47+
"phpunit/phpunit": "^10.5.45",
48+
"rector/rector": "^2.0.9",
4949
"roave/infection-static-analysis-plugin": "^1.35",
5050
"spatie/phpunit-watcher": "^1.24",
51-
"vimeo/psalm": "^5.26.1|^6.1",
51+
"vimeo/psalm": "^5.26.1 || ^6.8.6",
5252
"xepozz/internal-mocker": "^1.4.1",
5353
"yiisoft/middleware-dispatcher": "^5.2",
5454
"yiisoft/test-support": "^3.0.1"
@@ -64,6 +64,11 @@
6464
}
6565
},
6666
"extra": {
67+
"bamarni-bin": {
68+
"bin-links": true,
69+
"target-directory": "tools",
70+
"forward-command": true
71+
},
6772
"config-plugin-options": {
6873
"build-merge-plan": false
6974
}
@@ -72,9 +77,10 @@
7277
"sort-packages": true,
7378
"bump-after-update": "dev",
7479
"allow-plugins": {
75-
"infection/extension-installer": true,
80+
"bamarni/composer-bin-plugin": true,
7681
"composer/package-versions-deprecated": true,
77-
"yiisoft/config": true
82+
"infection/extension-installer": true,
83+
"yiisoft/config": false
7884
}
7985
},
8086
"scripts": {

phpunit.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
executionOrder="random"
1010
failOnRisky="true"
1111
failOnWarning="true"
12+
failOnDeprecation="true"
1213
stopOnFailure="false"
1314
colors="true"
1415
displayDetailsOnPhpunitDeprecations="true"

psalm.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
errorLevel="1"
44
findUnusedBaselineEntry="true"
55
findUnusedCode="false"
6+
ensureOverrideAttribute="false"
67
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
78
xmlns="https://getpsalm.org/schema/config"
89
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"

src/HttpApplicationRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private function emit(ServerRequestInterface $request, ResponseInterface $respon
198198
/**
199199
* @throws ErrorException
200200
*/
201-
private function registerErrorHandler(ErrorHandler $registered, ErrorHandler $unregistered = null): void
201+
private function registerErrorHandler(ErrorHandler $registered, ?ErrorHandler $unregistered = null): void
202202
{
203203
$unregistered?->unregister();
204204

tests/HttpApplicationRunnerTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@
3030
use Yiisoft\Di\Container;
3131
use Yiisoft\Di\ContainerConfig;
3232
use Yiisoft\ErrorHandler\ErrorHandler;
33-
use Yiisoft\ErrorHandler\Middleware\ErrorCatcher;
33+
use Yiisoft\ErrorHandler\Factory\ThrowableResponseFactory;
3434
use Yiisoft\ErrorHandler\Renderer\PlainTextRenderer;
3535
use Yiisoft\ErrorHandler\ThrowableRendererInterface;
36+
use Yiisoft\ErrorHandler\ThrowableResponseFactoryInterface;
3637
use Yiisoft\Middleware\Dispatcher\Event\AfterMiddleware;
3738
use Yiisoft\Middleware\Dispatcher\Event\BeforeMiddleware;
3839
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
39-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
40-
use Yiisoft\Middleware\Dispatcher\WrapperFactoryInterface;
4140
use Yiisoft\Test\Support\EventDispatcher\SimpleEventDispatcher;
4241
use Yiisoft\Test\Support\Log\SimpleLogger;
4342
use Yiisoft\Yii\Http\Application;
@@ -166,15 +165,15 @@ private function createDefinitions(bool $throwException): array
166165
return [
167166
EventDispatcherInterface::class => SimpleEventDispatcher::class,
168167
LoggerInterface::class => SimpleLogger::class,
169-
WrapperFactoryInterface::class => WrapperFactory::class,
170168
ResponseFactoryInterface::class => ResponseFactory::class,
171169
ServerRequestFactoryInterface::class => ServerRequestFactory::class,
172170
StreamFactoryInterface::class => StreamFactory::class,
173171
ThrowableRendererInterface::class => PlainTextRenderer::class,
174172
UriFactoryInterface::class => UriFactory::class,
175173
UploadedFileFactoryInterface::class => UploadedFileFactory::class,
176174

177-
ErrorCatcher::class => [
175+
ThrowableResponseFactoryInterface::class => [
176+
'class' => ThrowableResponseFactory::class,
178177
'forceContentType()' => ['text/plain'],
179178
],
180179

tests/Support/config/di-web.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
use Psr\Log\LoggerInterface;
2323
use Yiisoft\Definitions\DynamicReference;
2424
use Yiisoft\Definitions\Reference;
25-
use Yiisoft\ErrorHandler\Middleware\ErrorCatcher;
25+
use Yiisoft\ErrorHandler\Factory\ThrowableResponseFactory;
2626
use Yiisoft\ErrorHandler\Renderer\PlainTextRenderer;
2727
use Yiisoft\ErrorHandler\ThrowableRendererInterface;
28+
use Yiisoft\ErrorHandler\ThrowableResponseFactoryInterface;
2829
use Yiisoft\Middleware\Dispatcher\MiddlewareDispatcher;
29-
use Yiisoft\Middleware\Dispatcher\WrapperFactory;
30-
use Yiisoft\Middleware\Dispatcher\WrapperFactoryInterface;
3130
use Yiisoft\Test\Support\EventDispatcher\SimpleEventDispatcher;
3231
use Yiisoft\Test\Support\Log\SimpleLogger;
3332
use Yiisoft\Yii\Http\Application;
@@ -36,15 +35,15 @@
3635
return [
3736
EventDispatcherInterface::class => SimpleEventDispatcher::class,
3837
LoggerInterface::class => SimpleLogger::class,
39-
WrapperFactoryInterface::class => WrapperFactory::class,
4038
ResponseFactoryInterface::class => ResponseFactory::class,
4139
ServerRequestFactoryInterface::class => ServerRequestFactory::class,
4240
StreamFactoryInterface::class => StreamFactory::class,
4341
ThrowableRendererInterface::class => PlainTextRenderer::class,
4442
UriFactoryInterface::class => UriFactory::class,
4543
UploadedFileFactoryInterface::class => UploadedFileFactory::class,
4644

47-
ErrorCatcher::class => [
45+
ThrowableResponseFactoryInterface::class => [
46+
'class' => ThrowableResponseFactory::class,
4847
'forceContentType()' => ['text/plain'],
4948
],
5049

tools/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/*/vendor
2+
/*/composer.lock
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"require-dev": {
3+
"maglnet/composer-require-checker": "^4.7.1"
4+
},
5+
"config": {
6+
"bump-after-update": "dev"
7+
}
8+
}

0 commit comments

Comments
 (0)