8000 [VarDumper] Move locale sniffing to dump() time by nicolas-grekas · Pull Request #23574 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[VarDumper] Move locale sniffing to dump() time #23574

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/Symfony/Component/VarDumper/Dumper/AbstractDumper.php
8000
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ abstract class AbstractDumper implements DataDumperInterface, DumperInterface
public function __construct($output = null, $charset = null)
{
$this->setCharset($charset ?: ini_get('php.output_encoding') ?: ini_get('default_charset') ?: 'UTF-8');
$this->decimalPoint = (string) 0.5;
$this->decimalPoint = $this->decimalPoint[1];
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why keep the logic here as well? Can't we remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For BC, the property is protected.

$this->setOutput($output ?: static::$defaultOutput);
if (!$output && is_string(static::$defaultOutput)) {
static::$defaultOutput = $this->outputStream;
Expand Down Expand Up @@ -134,6 +134,9 @@ public function setIndentPad($pad)
*/
public function dump(Data $data, $output = null)
{
$this->decimalPoint = localeconv();
$this->decimalPoint = $this->decimalPoint['decimal_point'];

$exception = null;
if ($output) {
$prevOutput = $this->setOutput($output);
Expand Down
0