Skip to content

Commit 8d362e1

Browse files
committed
Do not rely on the current locale when dumping a Graphviz object
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'`
1 parent 7b3f47e commit 8d362e1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dumper/GraphvizDumper.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,11 @@ class GraphvizDumper extends Dumper
3232
{
3333
private $nodes;
3434
private $edges;
35+
// All values should be strings
3536
private $options = [
3637
'graph' => ['ratio' => 'compress'],
37-
'node' => ['fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'],
38-
'edge' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5],
38+
'node' => ['fontsize' => '11', 'fontname' => 'Arial', 'shape' => 'record'],
39+
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => '0.5'],
3940
'node.instance' => ['fillcolor' => '#9999ff', 'style' => 'filled'],
4041
'node.definition' => ['fillcolor' => '#eeeeee'],
4142
'node.missing' => ['fillcolor' => '#ff9999', 'style' => 'filled'],

0 commit comments

Comments
 (0)