Skip to content

Commit

Permalink
support for PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Jul 30, 2023
1 parent 46bc3db commit fc24539
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": ">=8.0 <8.3"
"php": ">=8.0 <8.4"
},
"require-dev": {
"nette/tester": "^2.5",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/Utils/Reflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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--;
Expand Down
2 changes: 1 addition & 1 deletion tests/Utils/DateTime.modifyClone.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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%',
);

0 comments on commit fc24539

Please sign in to comment.