Skip to content

Commit

Permalink
Do not rely on the current locale when dumping a Graphviz object
Browse files Browse the repository at this point in the history
Funny bug !

With `de_DE.UTF-8` as locale:
```
php > echo sprintf('%s', 0.5);
0,5
php > echo sprintf('%d', 0.5);
0
php > echo sprintf('%f', 0.5);
0,500000
php > echo (string) 0.5;
0,5
```

So now we force `'0.5'`
  • Loading branch information
lyrixx committed Feb 19, 2020
1 parent 70fb0df commit 46959fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dumper/GraphvizDumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
*/
class GraphvizDumper implements DumperInterface
{
// All values should be strings
protected static $defaultOptions = [
'graph' => ['ratio' => 'compress', 'rankdir' => 'LR'],
'node' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => true, 'width' => 1],
'edge' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => 0.5],
'node' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => '1', 'width' => '1'],
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => '0.5'],
];

/**
Expand Down

0 comments on commit 46959fb

Please sign in to comment.