From 9124157137da01b1f5a5a22d6486cb975f26db7e Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 30 Jul 2023 14:41:22 +0200 Subject: [PATCH] support for PHP 8.3 --- .github/workflows/tests.yml | 2 +- composer.json | 2 +- readme.md | 4 ++-- src/Utils/Reflection.php | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cb1b4d11d..f80fe1d1b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - php: ['8.0', '8.1', '8.2'] + php: ['8.0', '8.1', '8.2', '8.3'] fail-fast: false diff --git a/composer.json b/composer.json index bead361a3..42f4ec451 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.0 <8.3" + "php": ">=8.0 <8.4" }, "require-dev": { "nette/tester": "^2.5", diff --git a/readme.md b/readme.md index ff2ab46c3..530915f8f 100644 --- a/readme.md +++ b/readme.md @@ -40,8 +40,8 @@ The recommended way to install is via Composer: composer require nette/utils ``` -- Nette Utils 4.0 is compatible with PHP 8.0 to 8.2 -- Nette Utils 3.2 is compatible with PHP 7.2 to 8.2 +- Nette Utils 4.0 is compatible with PHP 8.0 to 8.3 +- Nette Utils 3.2 is compatible with PHP 7.2 to 8.3 - Nette Utils 3.1 is compatible with PHP 7.1 to 8.0 - Nette Utils 3.0 is compatible with PHP 7.1 to 8.0 - Nette Utils 2.5 is compatible with PHP 5.6 to 8.0 diff --git a/src/Utils/Reflection.php b/src/Utils/Reflection.php index f5cf4d7c6..5a4f2ab75 100644 --- a/src/Utils/Reflection.php +++ b/src/Utils/Reflection.php @@ -221,7 +221,8 @@ private static function parseUseStatements(string $code, ?string $forClass = nul $tokens = []; } - $namespace = $class = $classLevel = $level = null; + $namespace = $class = null; + $classLevel = $level = 0; $res = $uses = []; $nameTokens = [T_STRING, T_NS_SEPARATOR, T_NAME_QUALIFIED, T_NAME_FULLY_QUALIFIED]; @@ -290,7 +291,7 @@ private static function parseUseStatements(string $code, ?string $forClass = nul case ord('}'): if ($level === $classLevel) { - $class = $classLevel = null; + $class = $classLevel = 0; } $level--;