Repository navigation
Enable PHPDoc fixer config with parity preserved - #101
Merged
Merged
Conversation
blink hardcoded snake_case for PhpUnitMethodCasingFixer and ignored the rule's case option, so --blink rewrote camelCase test methods to snake_case on any project whose config keeps the PHP-CS-Fixer default (camel_case), diverging from ECS. - add a ConfigurableFixer interface; turbo config resolution applies it - PhpUnitMethodCasing reads case from the ECS config, defaults to camel_case - support both directions (camelCase and snake_case), including @Depends refs - cover both cases with unit tests
Wire per-fixer PHP-CS-Fixer options through the turbo/--blink path via the ConfigurableFixer interface: array, operator, spacing, casing, language, class, function, import, whitespace and control-structure fixers now read their options from the dumped ECS config, with full option semantics and unit tests. Zero-value structs keep today's behavior, so standalone parity stays 0/1699 and --blink parity is unchanged. PHPDoc fixers are deferred: honoring their options in a single pass diverges from ECS's iterate-to-fixpoint phpdoc handling, so they keep their tuned behavior.
Re-enable ECS config for the 9 PHPDoc fixers (line span, scalar, types, no-alias, tag casing, inline tag, order-by-value, return-self-reference, annotation-remove, no-superfluous). The turbo regression they caused was a single bug in PhpdocLineSpan: it classified an inline @var on a local variable as a property and reformatted it, which the real fixer (class members only) never touches. Require a preceding modifier before treating a bare $var as a property. Standalone parity stays 0/1699 and --blink parity returns to baseline with all 51 configurable fixers now honoring their ECS options.
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.
Completes the configurability work (stacks on #100). Re-enables ECS config for the 9 PHPDoc fixers, so all 51 configurable fixers now honor their options through
--blink.The fix
Wiring the PHPDoc fixers earlier regressed
--blinkparity 1->45. Investigation showed it was not a single-vs-multi-pass (fixpoint) issue - blink already converges; it converged to the wrong result. The whole regression came from one bug inPhpdocLineSpanFixer: it treated an inline/** @var Type $x */on a local variable as a class property and reformatted it (cascading into the inline-var docblock fixers). PHP-CS-Fixer's fixer only touches class members. Fix: a bare$varafter a docblock is only a property when a modifier (public/var/static/...) precedes it.Result
--blinkparity on this repo: back to 1 (the pre-existing TypeToVarTag Skip @type inside docblock description in TypeToVarTagFixer #81 case, unrelated)With #98 + #100 + this, all 51 configurable fixers honor their ECS config.