Skip to content

feat: implement NoDownMethodRule for Laravel and Phinx#1

Open
apostergiakis wants to merge 1 commit intoBellangelo:mainfrom
apostergiakis:feat/forbid-down
Open

feat: implement NoDownMethodRule for Laravel and Phinx#1
apostergiakis wants to merge 1 commit intoBellangelo:mainfrom
apostergiakis:feat/forbid-down

Conversation

@apostergiakis
Copy link

Summary

This PR introduces a new set of PHPStan rules (NoDownMethodRule) for both Laravel and Phinx migrations. These rules forbid the definition of a down() method, encouraging a strict "forward-only" migration strategy or strict adherence to the
change() method where supported.

Changes:

  • Implemented NoDownMethodRule (checks for public function down).
  • Added a helpful "tip" to the error message suggesting alternatives.
  • Registered the new rules in 'extension.neon'
  • Verification tests added (including anonymous class support for Laravel).
  • Updated README.md documentation.

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.

1 participant