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

Enable PHPStan Extensions outside of bleeding edge #31

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Aug 1, 2024

ondrej enabled the preg-match $matches inference feature with 1.12.x by default as it seems stable enough for general use.

the feature flag %featureToggles.narrowPregMatches% we rely on will be dropped with 1.12.

so there are 2 possible ways to handle it:

  1. we re-introduce the feature-flag as a noop in PHPstan 1.12.x as suggested by ondrej
  2. we remove usage of the feature flag, as we think the feature is already stable enough (so PHPStan-src 1.12.x does not need to take care of us using a non BC promise feature-flag)

@Seldaek wdyt about this options. do you feel confident to remove the feature flag for bleeding edge already within composer/pcre?

Comment on lines -11 to -12
Composer\Pcre\PHPStan\UnsafeStrictGroupsCallRule:
phpstan.rules.rule: %featureToggles.narrowPregMatches%
Copy link
Contributor Author

@staabm staabm Aug 1, 2024

Choose a reason for hiding this comment

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

btw: I think this UnsafeStrictGroupsCallRule conditional tag didn't work as expected because we always registered the class as a rule at line 21.
to make this conditional-tag work, we should have registered the rule as a service without a tag (and not below the rules: section) -> I think the rule was enabled no matter bleeding edge

@Seldaek
Copy link
Member

Seldaek commented Aug 1, 2024

Yeah I'd say let's remove it..

@staabm staabm marked this pull request as ready for review August 1, 2024 15:36
@staabm
Copy link
Contributor Author

staabm commented Aug 1, 2024

I agree.

people can stick with 2.2.0 or 3.2.0 in case a PHPStan-src fix is needed for some edge-case array-shape matching.
and I feel confident about the work we achieved already 🚀

staabm referenced this pull request in phpstan/phpstan-src Aug 1, 2024
@staabm
Copy link
Contributor Author

staabm commented Aug 1, 2024

regarding the failed build: I found sebastianbergmann/phpunit#5062 but could not yet find a way to repair the build (unrelated to the actual PR)

@staabm staabm marked this pull request as draft August 1, 2024 17:00
@staabm
Copy link
Contributor Author

staabm commented Aug 1, 2024

Put it back to draft, because I want to look into preg_match_all() before we drop bleeding edge

@Seldaek Seldaek marked this pull request as ready for review August 19, 2024 15:20
@Seldaek Seldaek merged commit d948ae8 into composer:2.x Aug 19, 2024
11 of 12 checks passed
@Seldaek
Copy link
Member

Seldaek commented Aug 19, 2024

Thanks

@staabm staabm deleted the patch-1 branch August 19, 2024 15:22
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