File tree Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Expand file tree Collapse file tree 4 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
26
26
</stability>
27
27
<license uri="https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt">BSD 3-Clause License</license>
28
28
<notes>
29
+ - The PHP 7.4 numeric separator backfill now works correctly for more float formats
29
30
- Fixed bug #2688 : Case statements not tokenized correctly when switch is contained within ternary
30
31
- Fixed bug #2698 : PHPCS throws errors determining auto report width when shell_exec is disabled
31
32
-- Thanks to Matthew Peveler for the patch
Original file line number Diff line number Diff line change @@ -1005,9 +1005,10 @@ protected function tokenize($string)
1005
1005
// Support floats.
1006
1006
if ($ tokens [$ i ][0 ] === T_STRING
1007
1007
&& substr (strtolower ($ tokens [$ i ][1 ]), -1 ) === 'e '
1008
- && $ tokens [($ i + 1 )] === '- '
1008
+ && ($ tokens [($ i + 1 )] === '- '
1009
+ || $ tokens [($ i + 1 )] === '+ ' )
1009
1010
) {
1010
- $ newContent .= ' - ' ;
1011
+ $ newContent .= $ tokens [( $ i + 1 )] ;
1011
1012
$ i ++;
1012
1013
}
1013
1014
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ $foo = 1_000_000_000;
9
9
/* testFloat */
10
10
$ foo = 6.674_083e-11 ;
11
11
12
+ /* testFloat2 */
13
+ $ foo = 6.674_083e+11 ;
14
+
12
15
/* testHex */
13
16
$ foo = 0xCAFE_F00D ;
14
17
Original file line number Diff line number Diff line change @@ -65,6 +65,13 @@ public function dataTestBackfill()
65
65
'value ' => '6.674_083e-11 ' ,
66
66
],
67
67
],
68
+ [
69
+ [
70
+ 'marker ' => '/* testFloat2 */ ' ,
71
+ 'type ' => T_DNUMBER ,
72
+ 'value ' => '6.674_083e+11 ' ,
73
+ ],
74
+ ],
68
75
[
69
76
[
70
77
'marker ' => '/* testHex */ ' ,
You can’t perform that action at this time.
0 commit comments