chore: make options that have default and allowed sets the same size the same array#8529
Merged
kubawerlos merged 8 commits intoPHP-CS-Fixer:masterfrom Mar 24, 2025
Conversation
…y are the same array
493b53c to
1d84914
Compare
keradus
reviewed
Mar 22, 2025
keradus
reviewed
Mar 22, 2025
keradus
reviewed
Mar 22, 2025
| private static function assertOptionDefault(FixerOptionInterface $option, FixerInterface $fixer): void | ||
| { | ||
| if (!$option->hasDefault()) { | ||
| return; |
Member
There was a problem hiding this comment.
if we claim it's assertion method, it should execute assertion in all paths
Member
Author
There was a problem hiding this comment.
what would you prefer?
- making the function dynamic to call
addToAssertionCount(which is a dynamic method) self::assertTru(true)😁- wrapping everything in a huge assert
Member
There was a problem hiding this comment.
assertion without assert count increased is weird. please increase the count (pick the best option you believe)
Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>
Co-authored-by: Dariusz Rumiński <dariusz.ruminski@gmail.com>
keradus
approved these changes
Mar 24, 2025
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.
Currently, some sets are the same size, but the order is different, e.g.:

(from https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/v3.73.1/doc/rules/class_notation/visibility_required.rst)
Let's make them in the same order.