Skip to content

Commit 65276e8

Browse files
1.5.4
- [*] фикс для совместимости с PHP8+ (заменяем list явным присвоением)
1 parent cc6fab2 commit 65276e8

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
/vendor/
2+
.idea
3+

src/AppRouter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,11 @@ public static function dispatch()
539539
// Fetch method and URI from somewhere
540540
self::$routeInfo = $routeInfo = (self::$dispatcher)->dispatch(self::$httpMethod, self::$uri);
541541

542-
list($state, $handler, $method_parameters) = $routeInfo;
542+
// list($state, $handler, $method_parameters) = $routeInfo;
543+
// PHP8+ good practice:
544+
$state = $routeInfo[0];
545+
$handler = $routeInfo[1] ?? [];
546+
$method_parameters = $routeInfo[2] ?? [];
543547

544548
// dispatch errors
545549
if ($state === Dispatcher::NOT_FOUND) {

0 commit comments

Comments
 (0)