Skip to content

Commit

Permalink
Fix example for adding separator to binary numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Wirone committed Jan 10, 2024
1 parent 3805278 commit 29433f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions doc/rules/basic/numeric_literal_separator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Configuration
``override_existing``
~~~~~~~~~~~~~~~~~~~~~

Reformat literals already containing underscores.
Whether literals already containing underscores should be reformatted.

Allowed types: ``bool``

Expand Down Expand Up @@ -59,10 +59,11 @@ With configuration: ``['strategy' => 'use_separator']``.
<?php
-$integer = 12345678;
-$octal = 0123456;
-$binary = 0b0010010011011010;
-$hexadecimal = 0x3D458F4F;
+$integer = 12_345_678;
+$octal = 0123_456;
$binary = 0b00100100;
-$hexadecimal = 0x3D458F4F;
+$binary = 0b00100100_11011010;
+$hexadecimal = 0x3D_45_8F_4F;
Example #3
Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/Basic/NumericLiteralSeparatorFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getDefinition(): FixerDefinitionInterface
<?php
$integer = 12345678;
$octal = 0123456;
$binary = 0b00100100;
$binary = 0b0010010011011010;
$hexadecimal = 0x3D458F4F;
PHP
Expand Down

0 comments on commit 29433f7

Please sign in to comment.