From 46959fb7e1f4d91101b688989c517eabd6632fe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Wed, 19 Feb 2020 15:48:16 +0100 Subject: [PATCH] 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'` --- Dumper/GraphvizDumper.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dumper/GraphvizDumper.php b/Dumper/GraphvizDumper.php index c3d673f..0f6cb33 100644 --- a/Dumper/GraphvizDumper.php +++ b/Dumper/GraphvizDumper.php @@ -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'], ]; /**