Repository navigation
Conversation
The branch names kept the keys of array_unique()/array_intersect(), so comparing them by index hit an undefined key and returned false.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intervals::isSubsetOf()fails for some constraints that exclude branches, even against themselves:generateIntervals()builds the branch names witharray_unique(),array_intersect()andarray_diff(), which keep the keys, so the list can have gaps (array(1 => 'dev-bar')).isSubsetOf()compares the names of the candidate and of the intersection by index, and the intersection of two excluding constraints is built witharray_merge(), which starts at 0 again. Where a handler turns warnings into exceptions, this throws.The names are now reindexed at the end of
generateIntervals(), so they are always a list.Tests: 3 cases in
SubsetsTestand 2 inIntervalsTest, all fail before the change. The full suite (2308 tests) passes, and phpstan reports nothing in the touched files. I also comparedisSubsetOf(),haveIntersections()andcompactConstraint()withmatches()over 20 versions and branches for 45,000 random constraint pairs: no difference is left, apart from constraints that match nothing.