Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

No description provided.

@simonLeary42 simonLeary42 requested a review from Copilot December 19, 2025 19:10
@simonLeary42 simonLeary42 changed the title level 4 phpstan level 4 Dec 19, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades PHPStan static analysis from level 3 to level 4, addressing stricter type checking and dead code detection. The changes clean up redundant code, improve type hints, and enhance test assertion clarity.

  • Upgraded PHPStan configuration from level 3 to level 4 with necessary error suppressions
  • Removed dead code including unreachable statements, redundant type checks, and unused properties
  • Improved type hints and replaced unclear test assertions with more explicit alternatives

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
phpstan.neon Updated PHPStan level to 4 and added error suppressions for known issues in test files
test/unit/CSRFTokenTest.php Removed redundant assertIsString check (covered by return type and regex validation)
test/functional/RegisterUserTest.php Replaced assertTrue(!x) with assertFalse(x) for clearer assertions
test/functional/PiMemberApproveTest.php Replaced assertTrue(!x) with assertFalse(x) for clearer assertions
test/functional/PIBecomeApproveTest.php Replaced assertTrue(!x) with assertFalse(x) for clearer assertions
resources/lib/UnityWebhook.php Removed unused $Subject property
resources/lib/UnityUser.php Removed redundant type checks made unnecessary by type hints and dead code after throw
resources/lib/UnityMailer.php Enhanced type hint from string to string|array to match actual usage
resources/lib/UnityHTTPD.php Replaced try-catch with explicit array_key_exists checks and removed redundant $_GET validation
resources/lib/UnityGroup.php Removed unreachable return statement after throw
resources/lib/PosixGroup.php Removed redundant type check made unnecessary by type hint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonLeary42 simonLeary42 merged commit 28604cc into main Dec 19, 2025
3 checks passed
@simonLeary42 simonLeary42 deleted the phpstan-level4 branch December 19, 2025 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants