From 74834dfbda191689adf4fa77c2e2a36871816e7e Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sun, 4 Jan 2026 20:08:32 +0000 Subject: [PATCH 1/5] CI: use PHP 8.2 for QA, add PHP 8.5 tests --- .github/workflows/codesniffer.yml | 5 ++++- .github/workflows/coverage.yml | 7 +++++-- .github/workflows/phpstan.yml | 7 +++++-- .github/workflows/tests.yml | 31 ++++++++++++++++++++++--------- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index dfc76ff..a58ac4f 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -2,6 +2,7 @@ name: "Codesniffer" on: pull_request: + workflow_dispatch: push: branches: ["*"] @@ -12,4 +13,6 @@ on: jobs: codesniffer: name: "Codesniffer" - uses: contributte/.github/.github/workflows/codesniffer.yml@v1 + uses: contributte/.github/.github/workflows/codesniffer.yml@master + with: + php: "8.2" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 121f718..fac01f8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -2,14 +2,17 @@ name: "Coverage" on: pull_request: + workflow_dispatch: push: branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 9 * * 1" jobs: coverage: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester-coverage.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master + with: + php: "8.2" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index db3ad34..13ceb07 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -2,14 +2,17 @@ name: "Phpstan" on: pull_request: + workflow_dispatch: push: branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 10 * * 1" jobs: phpstan: name: "Phpstan" - uses: contributte/.github/.github/workflows/phpstan.yml@v1 + uses: contributte/.github/.github/workflows/phpstan.yml@master + with: + php: "8.2" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5da2688..96bcc1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,29 +2,42 @@ name: "Nette Tester" on: pull_request: + workflow_dispatch: push: branches: ["*"] schedule: - - cron: "0 8 * * 1" + - cron: "0 10 * * 1" jobs: - test82: + test85: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.2" + php: "8.5" + + test84: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester.yml@master + with: + php: "8.4" - test81: + test83: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.1" + php: "8.3" + + test82: + name: "Nette Tester" + uses: contributte/.github/.github/workflows/nette-tester.yml@master + with: + php: "8.2" testlowest: name: "Nette Tester" - uses: contributte/.github/.github/workflows/nette-tester.yml@v1 + uses: contributte/.github/.github/workflows/nette-tester.yml@master with: - php: "8.1" + php: "8.2" composer: "composer update --no-interaction --no-progress --prefer-dist --prefer-stable --prefer-lowest" From d07c1b262cadeff87cfed072fb3d3a005cf93905 Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sun, 4 Jan 2026 20:08:40 +0000 Subject: [PATCH 2/5] Config: align configuration files with OSS standards --- .editorconfig | 2 +- .gitattributes | 9 ++++++++- .github/.kodiak.toml | 10 ---------- .gitignore | 16 +++++++++++++--- Makefile | 11 ++++++++--- phpstan.neon | 7 +------ ruleset.xml | 2 +- tests/.coveralls.yml | 4 ---- 8 files changed, 32 insertions(+), 29 deletions(-) delete mode 100644 .github/.kodiak.toml delete mode 100644 tests/.coveralls.yml diff --git a/.editorconfig b/.editorconfig index 3faf149..5e5b915 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,6 @@ indent_style = tab indent_size = tab tab_width = 4 -[{*.json, *.yaml, *.yml, *.md}] +[*.{json,yaml,yml,md}] indent_style = space indent_size = 2 diff --git a/.gitattributes b/.gitattributes index d3424bb..aad8529 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,10 @@ +.docs export-ignore +.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -tests/ export-ignore +.travis.yml export-ignore +Makefile export-ignore +README.md export-ignore +phpstan.neon export-ignore +ruleset.xml export-ignore +tests export-ignore diff --git a/.github/.kodiak.toml b/.github/.kodiak.toml deleted file mode 100644 index 60c34b6..0000000 --- a/.github/.kodiak.toml +++ /dev/null @@ -1,10 +0,0 @@ -version = 1 - -[merge] -automerge_label = "automerge" -blacklist_title_regex = "^WIP.*" -blacklist_labels = ["WIP"] -method = "rebase" -delete_branch_on_merge = true -notify_on_conflict = true -optimistic_updates = false diff --git a/.gitignore b/.gitignore index 5fc020f..f0b3670 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,14 @@ -/vendor/ -/.idea/ +# IDE +/.idea + +# Composer +/vendor /composer.lock -*.iml + +# Tests +/tests/tmp +/coverage.* +/tests/**/*.log +/tests/**/*.html +/tests/**/*.expected +/tests/**/*.actual diff --git a/Makefile b/Makefile index b232d62..33bc117 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -.PHONY: install qa cs csf phpstan tests coverage - +.PHONY: install install: composer update +.PHONY: qa qa: phpstan cs +.PHONY: cs cs: ifdef GITHUB_ACTION vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp -q --report=checkstyle src tests | cs2pr @@ -12,15 +13,19 @@ else vendor/bin/phpcs --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests endif +.PHONY: csf csf: - vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --colors -nsp src tests + vendor/bin/phpcbf --standard=ruleset.xml --encoding=utf-8 --extensions="php,phpt" --colors -nsp src tests +.PHONY: phpstan phpstan: vendor/bin/phpstan analyse -c phpstan.neon +.PHONY: tests tests: vendor/bin/tester -s -p php --colors 1 -C tests/Cases +.PHONY: coverage coverage: ifdef GITHUB_ACTION vendor/bin/tester -s -p phpdbg --colors 1 -C --coverage coverage.xml --coverage-src src tests/Cases diff --git a/phpstan.neon b/phpstan.neon index 8debc4b..cd64186 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,7 +3,7 @@ includes: parameters: level: 9 - phpVersion: 80100 + phpVersion: 80200 scanDirectories: - src @@ -14,8 +14,3 @@ parameters: paths: - src - .docs - - excludePaths: - - src/DI/SentryExtension24.php - - ignoreErrors: diff --git a/ruleset.xml b/ruleset.xml index 489ef79..9d2237c 100644 --- a/ruleset.xml +++ b/ruleset.xml @@ -1,6 +1,6 @@ - + diff --git a/tests/.coveralls.yml b/tests/.coveralls.yml deleted file mode 100644 index 8450382..0000000 --- a/tests/.coveralls.yml +++ /dev/null @@ -1,4 +0,0 @@ -# for php-coveralls -service_name: github-actions -coverage_clover: coverage.xml -json_path: coverage.json From cd58effdbb82a41ba5a18398b04caf7154c973ba Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sun, 4 Jan 2026 20:08:55 +0000 Subject: [PATCH 3/5] Fix: resolve PHPStan errors in PdfResponse --- src/PdfResponse.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/PdfResponse.php b/src/PdfResponse.php index cb5951b..57259b9 100644 --- a/src/PdfResponse.php +++ b/src/PdfResponse.php @@ -31,7 +31,7 @@ * @link http://addons.nette.org/cs/pdfresponse2 * @property string $saveMode * @property string $pageOrientation - * @property string|array $pageFormat + * @property string|array $pageFormat * @property string $pageMargins * @property string $documentAuthor * @property string $documentTitle @@ -104,7 +104,7 @@ class PdfResponse implements Response private bool $multiLanguage = false; - /** @var bool, REQUIRES symfony/dom-crawler package */ + /** @var bool REQUIRES symfony/dom-crawler package */ private bool $ignoreStylesInHTMLDocument = false; private string|Template $source; @@ -502,8 +502,7 @@ private function build(): Mpdf if ($this->source instanceof Template) { try { - /** @noinspection PhpMethodParametersCountMismatchInspection */ - $html = $this->source->__toString(true); + $html = $this->source->__toString(); } catch (Throwable $e) { throw new InvalidStateException('Template rendering failed', 0, $e); } From 841dd1a27d82ea874d70d9427e27e5998ff28ca2 Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Sun, 4 Jan 2026 20:09:04 +0000 Subject: [PATCH 4/5] Composer: require PHP 8.2+, use full version format --- composer.json | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index fd729e4..791f201 100644 --- a/composer.json +++ b/composer.json @@ -33,16 +33,16 @@ } ], "require": { - "php": ">=8.1", + "php": ">=8.2", "mpdf/mpdf": "^8.1.0", "nette/application": "^3.1.0", "nette/http": "^3.2.0" }, "require-dev": { + "contributte/phpstan": "^0.2.0", + "contributte/qa": "^0.4.0", + "contributte/tester": "^0.3.0", "nette/di": "^3.1.2", - "contributte/qa": "^0.4", - "contributte/tester": "^0.3", - "contributte/phpstan": "^0.1", "symfony/css-selector": "^6.3.0", "symfony/dom-crawler": "^6.3.0" }, @@ -58,6 +58,11 @@ "Contributte\\PdfResponse\\": "src/" } }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests" + } + }, "minimum-stability": "dev", "prefer-stable": true, "config": { From ccd247697389c93d1f018351d98aa785440c928b Mon Sep 17 00:00:00 2001 From: Contributte AI Date: Mon, 5 Jan 2026 16:36:29 +0000 Subject: [PATCH 5/5] CI: use PHP 8.4 for QA workflows --- .github/workflows/codesniffer.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/phpstan.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codesniffer.yml b/.github/workflows/codesniffer.yml index a58ac4f..590394f 100644 --- a/.github/workflows/codesniffer.yml +++ b/.github/workflows/codesniffer.yml @@ -15,4 +15,4 @@ jobs: name: "Codesniffer" uses: contributte/.github/.github/workflows/codesniffer.yml@master with: - php: "8.2" + php: "8.4" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index fac01f8..c51c356 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -15,4 +15,4 @@ jobs: name: "Nette Tester" uses: contributte/.github/.github/workflows/nette-tester-coverage-v2.yml@master with: - php: "8.2" + php: "8.4" diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 13ceb07..cd37eba 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -15,4 +15,4 @@ jobs: name: "Phpstan" uses: contributte/.github/.github/workflows/phpstan.yml@master with: - php: "8.2" + php: "8.4"