mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-11-30 04:29:15 +01:00
Merge branch '3.x'
This commit is contained in:
commit
d11ef05aaf
@ -8,7 +8,6 @@ class Name extends NodeAbstract
|
||||
{
|
||||
/**
|
||||
* @var string[] Parts of the name
|
||||
* @deprecated Avoid directly accessing $parts, use methods instead.
|
||||
*/
|
||||
public $parts;
|
||||
|
||||
|
@ -190,6 +190,11 @@ class Standard extends PrettyPrinterAbstract
|
||||
$stringValue = sprintf('%.17G', $node->value);
|
||||
}
|
||||
|
||||
// %G is locale dependent and there exists no locale-independent alternative. We don't want
|
||||
// mess with switching locales here, so let's assume that a comma is the only non-standard
|
||||
// decimal separator we may encounter...
|
||||
$stringValue = str_replace(',', '.', $stringValue);
|
||||
|
||||
// ensure that number is really printed as float
|
||||
return preg_match('/^-?[0-9]+$/', $stringValue) ? $stringValue . '.0' : $stringValue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user