Repository navigation
Blink: port 8 misc PHP-CS-Fixer fixers (Strict, Alias, Basic, Attribute, Namespace) - #286
Merged
Merged
Conversation
TomasVotruba
force-pushed
the
blink-port-misc
branch
2 times, most recently
from
November 4, 2026 17:20
391a365 to
a48bb7f
Compare
…te, Namespace) Adds faithful Go ports with parity tests mirroring upstream cases: - Strict/StrictComparisonFixer (== -> ===, != and <> -> !==) - Strict/StrictParamFixer ($strict arg for in_array, array_search, array_keys, base64_decode, mb_detect_encoding) - Alias/MbStrFunctionsFixer (base mb_* mappings; global calls and use-function imports) - Alias/RandomApiMigrationFixer (v3 defaults; configurable, random_int insertion) - Basic/OctalNotationFixer (0755 -> 0o755) - Basic/NumericLiteralSeparatorFixer (digit grouping; configurable) - NamespaceNotation/NoBlankLinesBeforeNamespaceFixer - AttributeNotation/AttributeEmptyParenthesesFixer (configurable) Registered in registry/All() only, with priorities and README rule counts updated.
TomasVotruba
force-pushed
the
blink-port-misc
branch
from
November 4, 2026 17:20
a48bb7f to
fe03f7a
Compare
Member
Author
|
@copilot resolve the merge conflicts in this pull request |
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.
Ports a batch of the "misc" PHP-CS-Fixer fixers to blink, each reimplemented faithfully from upstream with parity tests mirroring the upstream fixer test cases. Registered in the registry/
All()only (noconfig/set/changes). README rule counts and priorities updated;cmd/check-sourcesconfirms every newSourceURL()resolves.Landed (8)
Strict/StrictComparisonFixer==->===,!=and<>->!==(risky)Strict/StrictParamFixer$strictforin_array,array_search,array_keys,base64_decode,mb_detect_encoding; global calls only; stops when an earlier required arg is missingAlias/MbStrFunctionsFixermb_*mappings with per-function arg-count gating; renames global calls anduse functionimports. Version-gated additions (mb_str_pad,mb_trim, ...) intentionally omitted - see belowAlias/RandomApiMigrationFixerrand->mt_rand,srand->mt_srand,getrandmax->mt_getrandmax); configurablereplacements, incl.random_intzero-arg0, getrandmax()insertionBasic/OctalNotationFixer0755->0o755Basic/NumericLiteralSeparatorFixerstrategy+override_existingNamespaceNotation/NoBlankLinesBeforeNamespaceFixerblank_lines_before_namespacewith min 0 / max 1 line breaksAttributeNotation/AttributeEmptyParenthesesFixer()on attributes; configurableuse_parenthesesNote on
MbStrFunctionsFixer: only the always-present base map is ported. The PHP-version-gated additions (str_padon 8.3+,trim/ltrim/rtrimon 8.4+, each behind a runtimefunction_existsreflection check) are omitted so behaviour is deterministic and matches the version-independent upstream test cases; this is conservative for a risky fixer that is not part of any prepared set.Skipped (with reasons)
AttributeNotation/OrderedAttributesFixer- requires reordering attribute token ranges plus full FQN resolution for the sort order; high divergence risk against blink's token model.ClassUsage/DateTimeImmutableFixer- broad semantic rewrite (class references, method and function name mappings); not portable with parity confidence.Import/GroupImportFixer- multi-statement import grouping/sorting; complex, high risk.Comment/CommentToPhpdocFixer- structural comment analysis withignored_tags; complex.Comment/HeaderCommentFixer- only meaningful once configured (header text,comment_type,location,separate); default is a no-op and faithful configured behaviour is not portable with confidence.Squiz WhiteSpace/SuperfluousWhitespaceSniff- relies on PHP_CodeSniffer's per-line whitespace tokenization andhasCondition(T_FUNCTION/T_CLOSURE)scope tracking for the "multiple empty lines in a function" check; faithful parity not confident.Spacing/MethodChainingNewlineFixer(Symplify) - deprecated; depends on severalChainMethodCallAnalyzerheuristics andBlockFinder, so faithful parity is high-risk.Spacing/StandaloneLineConstructorParamFixer(Symplify) - the pre-split umbrella fixer; its behaviour is already covered by blink'sStandaloneLinePlainConstructorParam,StandaloneLineRequiredParamandStandaloneLineSymfonyAttributeParam.Gates
go build,go vet,go test -race,gofmt -s,go fix, gopls modernize, golangci-lint v2,check-sources, andrule-counts.sh --checkall pass locally.