Skip to content

Commit 46959fb

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 70fb0df commit 46959fb

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
@@ -26,10 +26,11 @@
2626
*/
2727
class GraphvizDumper implements DumperInterface
2828
{
29+
// All values should be strings
2930
protected static $defaultOptions = [
3031
'graph' => ['ratio' => 'compress', 'rankdir' => 'LR'],
31-
'node' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => true, 'width' => 1],
32-
'edge' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => 0.5],
32+
'node' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => '1', 'width' => '1'],
33+
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => '0.5'],
3334
];
3435

3536
/**

0 commit comments

Comments
 (0)