Skip to content

Commit 6bc169d

Browse files
authored
Explicitly marking parameters as nullable (#79)
1 parent d4f90a8 commit 6bc169d

11 files changed

Lines changed: 13 additions & 14 deletions

.github/workflows/bc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
os: >-
3131
['ubuntu-latest']
3232
php: >-
33-
['8.0']
33+
['8.4']

.github/workflows/mutation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ jobs:
2727
os: >-
2828
['ubuntu-latest']
2929
php: >-
30-
['8.2']
30+
['8.4']
3131
secrets:
3232
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## 2.2.2 under development
44

5-
- no changes in this release.
5+
- Bug #79: Explicitly marking parameters as nullable (@Tigrov)
66

77
## 2.2.1 March 05, 2025
88

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333
],
3434
"require": {
35-
"php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
35+
"php": "~7.4.0 || 8.0 - 8.4",
3636
"ext-hash": "*",
3737
"psr/http-factory": "^1.0",
3838
"psr/http-factory-implementation": "1.0",
@@ -48,8 +48,8 @@
4848
"require-dev": {
4949
"maglnet/composer-require-checker": "^3.8 || ^4.2",
5050
"nyholm/psr7": "^1.8.2",
51-
"phpunit/phpunit": "^9.6.22",
52-
"rector/rector": "^2.0.9",
51+
"phpunit/phpunit": "^9.6.23",
52+
"rector/rector": "^2.0.16",
5353
"roave/infection-static-analysis-plugin": "^1.18",
5454
"spatie/phpunit-watcher": "^1.23.6",
5555
"vimeo/psalm": "^4.30 || ^5.26.1 || ^6.8.8",
@@ -76,7 +76,6 @@
7676
},
7777
"config": {
7878
"sort-packages": true,
79-
"bump-after-update": "dev",
8079
"allow-plugins": {
8180
"infection/extension-installer": true,
8281
"composer/package-versions-deprecated": true

src/CsrfHeaderMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class CsrfHeaderMiddleware implements MiddlewareInterface
3737

3838
public function __construct(
3939
ResponseFactoryInterface $responseFactory,
40-
RequestHandlerInterface $failureHandler = null
40+
?RequestHandlerInterface $failureHandler = null
4141
) {
4242
$this->responseFactory = $responseFactory;
4343
$this->failureHandler = $failureHandler;

src/CsrfMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ final class CsrfMiddleware implements MiddlewareInterface
4242
public function __construct(
4343
ResponseFactoryInterface $responseFactory,
4444
CsrfTokenInterface $token,
45-
RequestHandlerInterface $failureHandler = null
45+
?RequestHandlerInterface $failureHandler = null
4646
) {
4747
$this->responseFactory = $responseFactory;
4848
$this->token = $token;

src/CsrfTokenMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class CsrfTokenMiddleware implements MiddlewareInterface
4141
public function __construct(
4242
ResponseFactoryInterface $responseFactory,
4343
CsrfTokenInterface $token,
44-
RequestHandlerInterface $failureHandler = null
44+
?RequestHandlerInterface $failureHandler = null
4545
) {
4646
$this->responseFactory = $responseFactory;
4747
$this->token = $token;

tests/CsrfHeaderMiddlewareProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
146146
}
147147

148148
private function createMiddleware(
149-
RequestHandlerInterface $failureHandler = null
149+
?RequestHandlerInterface $failureHandler = null
150150
): CsrfHeaderMiddleware {
151151
return new CsrfHeaderMiddleware(new Psr17Factory(), $failureHandler);
152152
}

tests/CsrfTokenMiddlewareProcessTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private function getBodyRequestParamsByToken(string $token): array
232232

233233
protected function createCsrfTokenMiddleware(
234234
?CsrfTokenInterface $csrfToken = null,
235-
RequestHandlerInterface $failureHandler = null
235+
?RequestHandlerInterface $failureHandler = null
236236
): CsrfTokenMiddleware {
237237
$csrfToken = new MaskedCsrfToken($csrfToken ?? $this->createCsrfToken());
238238
$this->token = $csrfToken->getValue();

tests/DeprecatedTokenCsrfMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ private function getBodyRequestParamsByToken(string $token): array
232232

233233
protected function createCsrfMiddleware(
234234
?CsrfTokenInterface $csrfToken = null,
235-
RequestHandlerInterface $failureHandler = null
235+
?RequestHandlerInterface $failureHandler = null
236236
): CsrfMiddleware {
237237
$csrfToken = new MaskedCsrfToken($csrfToken ?? $this->createCsrfToken());
238238
$this->token = $csrfToken->getValue();

0 commit comments

Comments
 (0)