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..d63550c02 100644 --- a/readme.md +++ b/readme.md @@ -40,7 +40,7 @@ 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 4.0 is compatible with PHP 8.0 to 8.3 - Nette Utils 3.2 is compatible with PHP 7.2 to 8.2 - 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 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--; diff --git a/tests/Utils/DateTime.modifyClone.phpt b/tests/Utils/DateTime.modifyClone.phpt index 2560b3624..4003e77f0 100644 --- a/tests/Utils/DateTime.modifyClone.phpt +++ b/tests/Utils/DateTime.modifyClone.phpt @@ -28,6 +28,6 @@ Assert::notSame((string) $date, (string) $dolly2); Assert::exception( fn() => $date->modifyClone('xx'), - Nette\InvalidArgumentException::class, + PHP_VERSION_ID >= 80300 ? DateMalformedStringException::class : Nette\InvalidArgumentException::class, 'DateTime::modify(): Failed to parse %a%', );