From 372ce41e231565ad6108e256604cf6c3487fbd51 Mon Sep 17 00:00:00 2001 From: Sandor Semsey Date: Fri, 2 May 2025 01:05:01 +0200 Subject: [PATCH 1/3] CI/php-cs-fixer: run on PHP 8.3 --- .github/workflows/php-cs-fixer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index 613dcba..72a8fd2 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -18,8 +18,8 @@ jobs: - name: Install php-cs-fixer uses: shivammathur/setup-php@v2 with: - php-version: 7.4 - tools: php-cs-fixer:3.38.2 + php-version: 8.3 + tools: php-cs-fixer:3.75 - name: Check code-style run: php-cs-fixer fix ${{ inputs.params }} From f6a5482bd12a1d378713a177891667b2d28d4664 Mon Sep 17 00:00:00 2001 From: Sandor Semsey Date: Fri, 2 May 2025 01:21:11 +0200 Subject: [PATCH 2/3] CI: use Symfony ruleset to test php-cs-fixer --- .github/workflows/main.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1eae2a9..957775f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,6 +12,7 @@ jobs: uses: ./.github/workflows/prettier.yml with: pattern: "**/*.yml" + test-beautysh: name: Test workflow (beautysh) needs: format @@ -19,6 +20,7 @@ jobs: with: dir: tests/workflows params: --force-function-style fnpar --indent-size 2 + test-mkdocs: name: Test workflow (mkdocs) needs: format @@ -26,18 +28,21 @@ jobs: with: plugins: mkdocs-literate-nav params: --strict + test-php-cs-fixer: name: Test workflow (php-cs-fixer) needs: format uses: ./.github/workflows/php-cs-fixer.yml with: - params: --dry-run -v --allow-risky=yes --rules=@PSR12:risky . + params: --dry-run -v --rules=@Symfony . + test-prettier: name: Test workflow (prettier) needs: format uses: ./.github/workflows/prettier.yml with: pattern: "**/*.json" + test-shellcheck: name: Test workflow (shellcheck) needs: format From 491fcb378ea956720f6537a596cd240bfee7324f Mon Sep 17 00:00:00 2001 From: Sandor Semsey Date: Fri, 2 May 2025 01:27:49 +0200 Subject: [PATCH 3/3] test.php: add PHP 8.3 syntax --- tests/workflows/test.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/workflows/test.php b/tests/workflows/test.php index a9b9c43..8a24a8e 100644 --- a/tests/workflows/test.php +++ b/tests/workflows/test.php @@ -5,24 +5,22 @@ */ class Mock { - /** - * @var string - */ - protected string $message; + public const string ERROR_MSG = 'oh no!'; - /** - * @param string $message - */ - public function __construct(string $message) + public function __construct(protected string $message) { - $this->message = $message; } - /** - * @return string - */ public function getMessage(): string { return $this->message; } + + /** + * This should be called on error. + */ + protected function error(): never + { + throw new Exception(self::ERROR_MSG); + } }