8000 minor #35786 Do not rely on the current locale when dumping a Graphvi… · symfony/symfony@7225a01 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7225a01

Browse files
minor #35786 Do not rely on the current locale when dumping a Graphviz object (lyrixx)
This PR was merged into the 3.4 branch. Discussion ---------- Do not rely on the current locale when dumping a Graphviz object | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | --- 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 external tools like graphviz could not parse `0,5` - and so skipped the arrow) So now we force `'0.5'` /cc @OskarStark Commits ------- 094e4bb Do not rely on the current locale when dumping a Graphviz object
2 parents 1c24ccc + 094e4bb commit 7225a01

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Symfony/Component/DependencyInjection/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'],

src/Symfony/Component/Workflow/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)
0