File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ private static function parseIntegerPart(string $number): string
225225 return '0 ' ;
226226 }
227227
228- if ($ number === '- ' ) {
228+ if ($ number === '- ' || $ number === ' -0 ' ) {
229229 return '-0 ' ;
230230 }
231231
@@ -244,6 +244,10 @@ private static function parseIntegerPart(string $number): string
244244 throw new InvalidArgumentException (sprintf ('Invalid integer part %1$s. Invalid digit %2$s found ' , $ number , $ digit ));
245245 }
246246
247+ if ($ digit === '- ' ) {
248+ continue ;
249+ }
250+
247251 if ($ nonZero === false && $ digit === '0 ' ) {
248252 throw new InvalidArgumentException ('Leading zeros are not allowed ' );
249253 }
Original file line number Diff line number Diff line change @@ -166,6 +166,7 @@ public static function invalidNumberExamples(): array
166166 ['' ],
167167 ['000 ' ],
168168 ['005 ' ],
169+ ['-005 ' ],
169170 ['123456789012345678-123456 ' ],
170171 ['---123 ' ],
171172 ['123456789012345678+13456 ' ],
You can’t perform that action at this time.
0 commit comments