From aebc7501952ee6107367733c7079bbaee88873eb Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:48:11 -0500 Subject: [PATCH 1/6] phpstan changes --- .github/workflows/phpstan.yml | 2 +- phpstan.neon | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 phpstan.neon diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index d5140a97..f6e11c99 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -17,4 +17,4 @@ jobs: php-version: "8.3" tools: composer - run: composer install --dev - - run: ./vendor/bin/phpstan --memory-limit=-1 analyse ./resources/ + - run: ./vendor/bin/phpstan analyse -c phpstan.neon diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 00000000..b90084e4 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,5 @@ +parameters: + level: 0 + paths: + - resources + - test From 7cb25c54502d6339ea8c26860ad0c9346790b44c Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:50:26 -0500 Subject: [PATCH 2/6] bootstrap --- phpstan.neon | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index b90084e4..40e8868c 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,7 @@ parameters: level: 0 paths: - - resources - - test + - resources + - test + bootstrapFiles: + - test/phpunit-bootstrap.php From ffdf8b36c039bb2bd794080dbd5c9dcd27f21ad5 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:56:20 -0500 Subject: [PATCH 3/6] fix errors --- test/functional/AccountDeletionRequestTest.php | 2 +- test/functional/PiBecomeRequestTest.php | 2 +- test/functional/PiMemberDenyTest.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/functional/AccountDeletionRequestTest.php b/test/functional/AccountDeletionRequestTest.php index d8c4bb04..d33eab1c 100644 --- a/test/functional/AccountDeletionRequestTest.php +++ b/test/functional/AccountDeletionRequestTest.php @@ -14,7 +14,7 @@ private function assertNumberAccountDeletionRequests(int $x) $this->assertTrue($USER->hasRequestedAccountDeletion()); $this->assertTrue($SQL->accDeletionRequestExists($USER->uid)); } else { - throw new RuntimeError("x must not be negative"); + throw new \RuntimeError("x must not be negative"); } $this->assertEquals($x, $this->getNumberAccountDeletionRequests()); } diff --git a/test/functional/PiBecomeRequestTest.php b/test/functional/PiBecomeRequestTest.php index 6a549a5b..08f6482b 100644 --- a/test/functional/PiBecomeRequestTest.php +++ b/test/functional/PiBecomeRequestTest.php @@ -13,7 +13,7 @@ private function assertNumberPiBecomeRequests(int $x) } elseif ($x > 0) { $this->assertTrue($SQL->requestExists($USER->uid)); } else { - throw new RuntimeError("x must not be negative"); + throw new \RuntimeError("x must not be negative"); } $this->assertEquals($x, $this->getNumberPiBecomeRequests()); } diff --git a/test/functional/PiMemberDenyTest.php b/test/functional/PiMemberDenyTest.php index 373bab5b..bb5ca84e 100644 --- a/test/functional/PiMemberDenyTest.php +++ b/test/functional/PiMemberDenyTest.php @@ -17,7 +17,7 @@ public static function setUpBeforeClass(): void private function denyUser(string $uid) { - post(__DIR__ . "/../../webroot/panel/pi.php", [ + http_post(__DIR__ . "/../../webroot/panel/pi.php", [ "form_type" => "userReq", "action" => "approve", "uid" => $uid, From dbf2ffd1a6e753e471575f7273a5e8bf1024b10a Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:56:36 -0500 Subject: [PATCH 4/6] remove bootstrap files --- phpstan.neon | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 40e8868c..24e5d6ae 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -3,5 +3,3 @@ parameters: paths: - resources - test - bootstrapFiles: - - test/phpunit-bootstrap.php From 0b65242050adb000ef846f3c5535cc7f5f9730cf Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:58:19 -0500 Subject: [PATCH 5/6] runtimeerror -> runtimeexception --- test/functional/AccountDeletionRequestTest.php | 2 +- test/functional/PiBecomeRequestTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/functional/AccountDeletionRequestTest.php b/test/functional/AccountDeletionRequestTest.php index d33eab1c..ad2fc8f3 100644 --- a/test/functional/AccountDeletionRequestTest.php +++ b/test/functional/AccountDeletionRequestTest.php @@ -14,7 +14,7 @@ private function assertNumberAccountDeletionRequests(int $x) $this->assertTrue($USER->hasRequestedAccountDeletion()); $this->assertTrue($SQL->accDeletionRequestExists($USER->uid)); } else { - throw new \RuntimeError("x must not be negative"); + throw new RuntimeException("x must not be negative"); } $this->assertEquals($x, $this->getNumberAccountDeletionRequests()); } diff --git a/test/functional/PiBecomeRequestTest.php b/test/functional/PiBecomeRequestTest.php index 08f6482b..317a1bdd 100644 --- a/test/functional/PiBecomeRequestTest.php +++ b/test/functional/PiBecomeRequestTest.php @@ -13,7 +13,7 @@ private function assertNumberPiBecomeRequests(int $x) } elseif ($x > 0) { $this->assertTrue($SQL->requestExists($USER->uid)); } else { - throw new \RuntimeError("x must not be negative"); + throw new RuntimeException("x must not be negative"); } $this->assertEquals($x, $this->getNumberPiBecomeRequests()); } From 5b799c771831d618aece40865553628a89eb0031 Mon Sep 17 00:00:00 2001 From: Simon Leary Date: Fri, 7 Nov 2025 13:59:25 -0500 Subject: [PATCH 6/6] fix name --- .github/workflows/phpstan.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index f6e11c99..36778543 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -6,7 +6,7 @@ on: branches: [main] jobs: - pre-commit: + phpstan: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3