Skip to content

Commit 07794fd

Browse files
committed
support for PHP 8.5
1 parent f482581 commit 07794fd

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
strategy:
99
matrix:
10-
php: ['8.1', '8.2', '8.3', '8.4']
10+
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
1111

1212
fail-fast: false
1313

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": "8.1 - 8.4",
18+
"php": "8.1 - 8.5",
1919
"nette/http": "^3.2 || ~4.0.0",
2020
"nette/utils": "^4.0"
2121
},

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The router is responsible for everything about URLs so that you no longer have t
1414
- a few notes about SEO redirection
1515
- and we'll show you how to write your own router
1616

17-
It requires PHP version 8.1 and supports PHP up to 8.4.
17+
It requires PHP version 8.1 and supports PHP up to 8.5.
1818

1919
Documentation can be found on the [website](https://doc.nette.org/routing).
2020

src/Routing/Route.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,8 @@ public function match(Nette\Http\IRequest $httpRequest): ?array
235235
}
236236
}
237237

238-
if (isset($this->metadata[null][self::FilterIn])) {
239-
$params = $this->metadata[null][self::FilterIn]($params);
238+
if (isset($this->metadata[''][self::FilterIn])) {
239+
$params = $this->metadata[''][self::FilterIn]($params);
240240
if ($params === null) {
241241
return null;
242242
}
@@ -297,7 +297,7 @@ public function constructUrl(array $params, Nette\Http\UrlScript $refUrl): ?stri
297297

298298
private function preprocessParams(array &$params): bool
299299
{
300-
$filter = $this->metadata[null][self::FilterOut] ?? null;
300+
$filter = $this->metadata[''][self::FilterOut] ?? null;
301301
if ($filter) {
302302
$params = $filter($params);
303303
if ($params === null) {

src/Routing/RouteList.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function constructUrl(array $params, Nette\Http\UrlScript $refUrl): ?stri
116116
$this->warmupCache();
117117
}
118118

119-
$key = $params[$this->cacheKey] ?? null;
119+
$key = $params[$this->cacheKey ?? ''] ?? null;
120120
if (!is_scalar($key) || !isset($this->ranks[$key])) {
121121
$key = '*';
122122
}
@@ -167,7 +167,7 @@ public function warmupCache(): void
167167
$ranks = ['*' => []];
168168

169169
foreach ($routers as [$router, $params]) {
170-
$value = $params[$this->cacheKey] ?? null;
170+
$value = $params[$this->cacheKey ?? ''] ?? null;
171171
$values = $value === null
172172
? array_keys($ranks)
173173
: [is_scalar($value) ? $value : '*'];

0 commit comments

Comments
 (0)