From 5af5265d7556baeaa4851d9e588cb9e8e0f4f071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:20:16 +0100 Subject: [PATCH 1/6] Composer: Update PhpStan --- composer.json | 2 +- phpstan.neon | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5398c21..51ffe72 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "require-dev": { "nette/tester": "^2.4", "nette/utils": "^3.2.5", - "phpstan/phpstan": "^0.12.98" + "phpstan/phpstan": "1.9.2" }, "suggest": { "nette/utils": "Allows to safe escape HTML with markup: https://doc.nette.org/en/utils/html-elements" diff --git a/phpstan.neon b/phpstan.neon index 57ea1e8..443e40c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,6 +1,6 @@ parameters: ignoreErrors: - - message: '#Instanceof between mixed and Nette\\HtmlStringable will always evaluate to false\.#' + message: '#Instanceof between mixed and Nette\\Utils\\IHtmlString will always evaluate to false\.#' path: src/Escape.php count: 2 From 04a971745ca570790e1fc537451d43c4ee6112dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:24:18 +0100 Subject: [PATCH 2/6] Composer: Normalize --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 51ffe72..b11851c 100644 --- a/composer.json +++ b/composer.json @@ -1,13 +1,13 @@ { "name": "jakubboucek/legacy-escape", "description": "Right escape data inserted to HTML, CSS, JS and URL. Substrate of Latte/Latte package.", - "type": "library", "license": [ "MIT", "BSD-3-Clause", "GPL-2.0-only", "GPL-3.0-only" ], + "type": "library", "authors": [ { "name": "Jakub Bouček", @@ -31,11 +31,11 @@ "JakubBoucek\\Escape\\": "src/" } }, + "config": { + "sort-packages": true + }, "scripts": { "phpstan": "phpstan analyze src -c phpstan.neon --level 7", "tester": "tester tests" - }, - "config": { - "sort-packages": true } } From b4fc13df547a012141e0a5f5f7aca3644b9edbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:41:00 +0100 Subject: [PATCH 3/6] PhpStan: Add support for lower version of Nette Utils dep --- phpstan.neon | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 443e40c..04c4cab 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,3 +4,9 @@ parameters: message: '#Instanceof between mixed and Nette\\Utils\\IHtmlString will always evaluate to false\.#' path: src/Escape.php count: 2 + reportUnmatched: false + - + message: '#Class Nette\\HtmlStringable not found\.#' + path: src/Escape.php + count: 2 + reportUnmatched: false From 456359ba852be6821b2d34a0baef79bc93579fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:41:25 +0100 Subject: [PATCH 4/6] Composer: Expand to support Nette/Utils 3.1+ --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b11851c..3c67347 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "nette/tester": "^2.4", - "nette/utils": "^3.2.5", + "nette/utils": "^3.1", "phpstan/phpstan": "1.9.2" }, "suggest": { From 4c31e02e5ab16692b8baf8d066b170c6853a6286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:45:57 +0100 Subject: [PATCH 5/6] CI: Add PHP 8.2 --- .github/workflows/code_analysis.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 6aabbed..643b990 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -15,6 +15,7 @@ jobs: - '7.4' - '8.0' - '8.1' + - '8.2' actions: - name: PHPStan run: composer phpstan From 17f78d43bafdafe093ee4441caa3373dc5646b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Sun, 11 Dec 2022 21:46:19 +0100 Subject: [PATCH 6/6] CI: Add lowest/newest --- .github/workflows/code_analysis.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 643b990..5b53e68 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -22,8 +22,16 @@ jobs: - name: Unit tests run: vendor/bin/tester tests -s -C + versions: + - name: newest + arg: '' + experimental: false - name: ${{ matrix.actions.name }} at PHP ${{ matrix.php }} + - name: lowest + arg: '--prefer-lowest' + experimental: true + + name: ${{ matrix.actions.name }} at PHP ${{ matrix.php }} (${{ matrix.versions.name }}) runs-on: ubuntu-latest steps: @@ -54,6 +62,7 @@ jobs: - name: Install Composer - run: composer install --no-progress + run: composer update --no-progress ${{ matrix.versions.arg }} - run: ${{ matrix.actions.run }} + continue-on-error: ${{ matrix.versions.experimental }}