From 9aaf150e74b630223adef12b3a6cad3af0361bf0 Mon Sep 17 00:00:00 2001 From: Alexander Lentner Date: Tue, 12 Nov 2024 22:17:30 +0100 Subject: [PATCH 1/4] Fix PHP 8.4 deprecations --- tests/Pest.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Pest.php b/tests/Pest.php index 64c24a5..a3f34d2 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -19,7 +19,7 @@ return $this; }); -expect()->extend('toBeExactGuess', function (float $boost = null) { +expect()->extend('toBeExactGuess', function (?float $boost = null) { $expectedPoints = (float) (new DefaultCalculationModel())->getPointsForExactGuess(); $expectedPoints = $boost ? $expectedPoints * $boost : $expectedPoints; @@ -33,7 +33,7 @@ return $this; }); -expect()->extend('toBeWrongGuess', function (float $boost = null) { +expect()->extend('toBeWrongGuess', function (?float $boost = null) { $expectedPoints = (float) (new DefaultCalculationModel())->getPointsForWrongGuess(); $expectedPoints = $boost ? $expectedPoints * $boost : $expectedPoints; @@ -47,7 +47,7 @@ return $this; }); -expect()->extend('toBeExactGapGuess', function (float $boost = null) { +expect()->extend('toBeExactGapGuess', function (?float $boost = null) { $expectedPoints = (float) (new DefaultCalculationModel())->getPointsForExactGap(); $expectedPoints = $boost ? $expectedPoints * $boost : $expectedPoints; @@ -61,7 +61,7 @@ return $this; }); -expect()->extend('toBeCorrectTendencyGuess', function (float $boost = null) { +expect()->extend('toBeCorrectTendencyGuess', function (?float $boost = null) { $expectedPoints = (float) (new DefaultCalculationModel())->getPointsForTendency(); $expectedPoints = $boost ? $expectedPoints * $boost : $expectedPoints; @@ -75,7 +75,7 @@ return $this; }); -expect()->extend('toBeDrawGapGuess', function (float $boost = null) { +expect()->extend('toBeDrawGapGuess', function (?float $boost = null) { $expectedPoints = (float) (new DefaultCalculationModel())->getPointsForDrawGap(); $expectedPoints = $boost ? $expectedPoints * $boost : $expectedPoints; From 2ed4758645a54c60c3e62a8ba184d7407a6567f9 Mon Sep 17 00:00:00 2001 From: Alexander Lentner Date: Tue, 12 Nov 2024 22:18:04 +0100 Subject: [PATCH 2/4] Update dependencies --- composer.json | 8 ++++---- phpstan.neon | 10 +++------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index cdeca1a..7ce30e1 100644 --- a/composer.json +++ b/composer.json @@ -6,10 +6,10 @@ "php": "8.3.*" }, "require-dev": { - "laravel/pint": "^1.14", - "pestphp/pest": "^2.34", - "pestphp/pest-plugin-type-coverage": "^2.8", - "phpstan/phpstan": "^1.10.59" + "laravel/pint": "^1.0", + "pestphp/pest": "^3.0", + "pestphp/pest-plugin-type-coverage": "^3.0", + "phpstan/phpstan": "^1.0" }, "autoload": { "psr-4": { diff --git a/phpstan.neon b/phpstan.neon index 9a59341..3a0decc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,23 +5,19 @@ parameters: level: max treatPhpDocTypesAsCertain: false - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false reportUnmatchedIgnoredErrors: true ignoreErrors: - # Pest implicitly binds $this to the current test case - # @see https://pestphp.com/docs/underlying-test-case - message: '#^Undefined variable: \$this$#' - reportUnmatched: false path: tests/* - message: '#^Call to an undefined method Pest\\Expectation<([a-zA-Z|\\\\]+)>\:\:[a-zA-Z]+\(\)\.$#' - reportUnmatched: false path: tests/* - message: "#^Call to an undefined method Pest\\\\PendingCalls\\\\TestCall\\:\\:expect\\(\\)\\.$#" - reportUnmatched: false + path: tests/* + - + message: "#^Access to an undefined property PHPUnit\\\\Framework\\\\TestCase\\:\\:\\$#" path: tests/* From 345a22227a05015a5f5941218b177517cae9c604 Mon Sep 17 00:00:00 2001 From: Alexander Lentner Date: Tue, 12 Nov 2024 22:28:25 +0100 Subject: [PATCH 3/4] Switch to github actions runner --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a3c7e0..af78187 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ jobs: matrix: php: [ "8.3" ] - runs-on: [self-hosted, linux, x64] + runs-on: [ubuntu-latest] name: PHP@${{ matrix.php }} steps: From 71de5238af27d2003e1da648a0873bad88ab7794 Mon Sep 17 00:00:00 2001 From: Alexander Lentner Date: Tue, 12 Nov 2024 22:30:44 +0100 Subject: [PATCH 4/4] Allow PHP 8.4. usage --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7ce30e1..0b67943 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "type": "package", "description": "The Gaudigame Engine", "require": { - "php": "8.3.*" + "php": "8.3.* | 8.4.*" }, "require-dev": { "laravel/pint": "^1.0",