Skip to content

Add RemoveSlashFromNativeConstantFixer (PHP + blink) - #220

Merged
TomasVotruba merged 2 commits into
mainfrom
remove-slash-from-native-constant-fixer
Oct 26, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
remove-slash-from-native-constant-fixer

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds a fixer that strips the redundant leading backslash from the true, false and null constants:

return \true;   // ->   return true;
return \false;  // ->   return false;
return \null;   // ->   return null;
  • PHP: Symplify\CodingStandard\Fixer\ConstantNotation\RemoveSlashFromNativeConstantFixer, added to the common namespaces set.
  • blink: ported as RemoveSlashFromNativeConstant (registry, priority 0, source map, README rule counts).
  • Casing is preserved; namespace segments like Foo\True\Value and \true\Bar are left untouched.

Covered by PHPUnit fixture tests and a Go test.

Strips the redundant leading backslash from the true, false and null
constants (\true -> true). Added to the common namespaces set and
ported to the blink Go runner.
@TomasVotruba
TomasVotruba merged commit a74f5e0 into main Oct 26, 2026
20 checks passed
@TomasVotruba
TomasVotruba deleted the remove-slash-from-native-constant-fixer branch October 26, 2026 12:29
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.

1 participant