From b80c3a628cfbfa35574f477007150afd181e55bf Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 18 Jun 2024 23:25:41 +0200 Subject: [PATCH] support for PHP 8.4 --- .github/workflows/tests.yml | 2 +- composer.json | 10 +++++----- src/Latte/Compiler/TagLexer.php | 2 +- src/Latte/Compiler/TemplateParser.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1c9a739b..1105bac5b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.0', '8.1', '8.2', '8.3'] + php: ['8.0', '8.1', '8.2', '8.3', '8.4'] fail-fast: false diff --git a/composer.json b/composer.json index a735d680a..40946a0dd 100644 --- a/composer.json +++ b/composer.json @@ -15,16 +15,16 @@ } ], "require": { - "php": "8.0 - 8.3", + "php": "8.0 - 8.4", "ext-json": "*", "ext-tokenizer": "*" }, "require-dev": { - "nette/tester": "^2.0", - "tracy/tracy": "^2.3", - "nette/utils": "^3.0", + "nette/tester": "^2.5", + "tracy/tracy": "^2.10", + "nette/utils": "^4.0", "phpstan/phpstan": "^1", - "nette/php-generator": "^3.6 || ^4.0" + "nette/php-generator": "^4.0" }, "suggest": { "ext-iconv": "to use filters |reverse, |substring", diff --git a/src/Latte/Compiler/TagLexer.php b/src/Latte/Compiler/TagLexer.php index 38bbf014e..710b603e2 100644 --- a/src/Latte/Compiler/TagLexer.php +++ b/src/Latte/Compiler/TagLexer.php @@ -66,7 +66,7 @@ public function tokenize(string $input, ?Position $position = null): array /** @return Token[] */ - public function tokenizePartially(string $input, Position &$position, int $ofs = null): array + public function tokenizePartially(string $input, Position &$position, ?int $ofs = null): array { $this->input = $input; $this->offset = $ofs ?? $position->offset; diff --git a/src/Latte/Compiler/TemplateParser.php b/src/Latte/Compiler/TemplateParser.php index 2dd8eb9f6..279ee6406 100644 --- a/src/Latte/Compiler/TemplateParser.php +++ b/src/Latte/Compiler/TemplateParser.php @@ -82,7 +82,7 @@ public function parse(string $template): Nodes\TemplateNode } - public function parseFragment(callable $resolver, callable $after = null): FragmentNode + public function parseFragment(callable $resolver, ?callable $after = null): FragmentNode { $res = new FragmentNode; $save = [$this->lastResolver, $this->tag];