Skip to content

refactor: upgrade PHPStan to level 6 with type annotations#189

Merged
danielhe4rt merged 5 commits into4.xfrom
refactor/phpstan-level-6-upgrade
Mar 23, 2026
Merged

refactor: upgrade PHPStan to level 6 with type annotations#189
danielhe4rt merged 5 commits into4.xfrom
refactor/phpstan-level-6-upgrade

Conversation

@danielhe4rt
Copy link
Contributor

@danielhe4rt danielhe4rt commented Mar 23, 2026

Summary

  • Upgrade PHPStan from level 1 to level 6
  • Add proper PHPDoc annotations across events module and app
  • Fix type safety issues identified by stricter analysis

Changes

  • phpstan.neon: level 1 → level 6
  • Events models: proper @property, @return, and @param annotations
  • Filament resources: type-safe static analysis fixes
  • App support files: improved type annotations

Testing

  • composer phpstan passes

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved null-safety when retrieving event attendance information
    • Fixed potential null reference issues when checking event participation status
  • Refactor

    • Enhanced type safety and null-checking throughout the application
    • Optimized queries for participant and attendance lookups
  • Chores

    • Increased static code analysis strictness to improve overall code quality
    • Improved code documentation and type annotations for better maintainability

@danielhe4rt danielhe4rt merged commit 10b5e59 into 4.x Mar 23, 2026
5 of 6 checks passed
@danielhe4rt danielhe4rt deleted the refactor/phpstan-level-6-upgrade branch March 23, 2026 00:55
@coderabbitai
Copy link

coderabbitai bot commented Mar 23, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request introduces comprehensive type safety improvements across the codebase. Changes include adding PHPDoc annotations and return type declarations to numerous methods, strengthening null-safety with null-safe operators and explicit null checks, updating Eloquent relationship type documentation to reflect actual pivot models, and refactoring some direct method chains to use typed local variables. The configuration updates PHPStan analysis level from 1 to 6 and adjusts analysis scope. Additionally, .gitignore is updated to exclude a new path, and several middleware and contract type signatures are formalized.

Suggested reviewers

  • gvieira18
  • thalesmengue
  • Clintonrocha98
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.85% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor: upgrade PHPStan to level 6 with type annotations' accurately and concisely describes the main objective of the PR, which is upgrading PHPStan to level 6 and adding comprehensive type annotations throughout the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can approve the review once all CodeRabbit's comments are resolved.

Enable the reviews.request_changes_workflow setting to automatically approve the review once all CodeRabbit's comments are resolved.

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