Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: preparation for PHPStan 2: remove CheckUseStatementsAfterLicenseRule #9321

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

samsonasik
Copy link
Member

Description

The CheckUseStatementsAfterLicenseRule rule is rely onprevious attribute, which no longer exists in PHPStan 2, I think this can be removed.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@samsonasik
Copy link
Member Author

Ready to merge 👍

@paulbalandan
Copy link
Member

I was thinking days ago if this rule can be adapted to phpstan v2? or this rule has gone completely unnecessary?

@samsonasik
Copy link
Member Author

This rule was exists in the day the docblock location was mixed, since likely when creating new file, we copy paste existing code and modify, so location unmatch with @license placed after use can be seen and verify manually, that's will be rare use case imo.

To make adaptable to v2, it can be modified to use FileNode or Namespace_, loop its stmt until found a Use_ with next stmt with @license doc, but I am not sure if it worth the effort

Copy link
Member

@paulbalandan paulbalandan left a comment

Choose a reason for hiding this comment

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

TBH, with our current tooling I think this rule is no longer necessary, so I'm ok with this being deleted.

@samsonasik
Copy link
Member Author

Thank you @paulbalandan @michalsn for the review, let's merge 👍

@samsonasik samsonasik merged commit f0536a1 into codeigniter4:develop Dec 13, 2024
11 checks passed
@samsonasik samsonasik deleted the chore-prepare-phpstan-2 branch December 13, 2024 18:09
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.

3 participants