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
-------
094e4bbbc2
Do not rely on the current locale when dumping a Graphviz object
This commit is contained in:
commit
7225a01bc6
@ -32,10 +32,11 @@ class GraphvizDumper extends Dumper
|
|||||||
{
|
{
|
||||||
private $nodes;
|
private $nodes;
|
||||||
private $edges;
|
private $edges;
|
||||||
|
// All values should be strings
|
||||||
private $options = [
|
private $options = [
|
||||||
'graph' => ['ratio' => 'compress'],
|
'graph' => ['ratio' => 'compress'],
|
||||||
'node' => ['fontsize' => 11, 'fontname' => 'Arial', 'shape' => 'record'],
|
'node' => ['fontsize' => '11', 'fontname' => 'Arial', 'shape' => 'record'],
|
||||||
'edge' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => 0.5],
|
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => '0.5'],
|
||||||
'node.instance' => ['fillcolor' => '#9999ff', 'style' => 'filled'],
|
'node.instance' => ['fillcolor' => '#9999ff', 'style' => 'filled'],
|
||||||
'node.definition' => ['fillcolor' => '#eeeeee'],
|
'node.definition' => ['fillcolor' => '#eeeeee'],
|
||||||
'node.missing' => ['fillcolor' => '#ff9999', 'style' => 'filled'],
|
'node.missing' => ['fillcolor' => '#ff9999', 'style' => 'filled'],
|
||||||
|
@ -26,10 +26,11 @@ use Symfony\Component\Workflow\Marking;
|
|||||||
*/
|
*/
|
||||||
class GraphvizDumper implements DumperInterface
|
class GraphvizDumper implements DumperInterface
|
||||||
{
|
{
|
||||||
|
// All values should be strings
|
||||||
protected static $defaultOptions = [
|
protected static $defaultOptions = [
|
||||||
'graph' => ['ratio' => 'compress', 'rankdir' => 'LR'],
|
'graph' => ['ratio' => 'compress', 'rankdir' => 'LR'],
|
||||||
'node' => ['fontsize' => 9, 'fontname' => 'Arial', 'color' => '#333333', 'fillcolor' => 'lightblue', 'fixedsize' => true, 'width' => 1],
|
'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],
|
'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => '#333333', 'arrowhead' => 'normal', 'arrowsize' => '0.5'],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user