Skip to content

Commit 798d600

Browse files
amenkcyl3x
andcommitted
NEXT-00000 Fix: failing assert in bin/console state-machine:dump
``` bin/console state-machine:dump order.state ``` fails assert(\is_string($v)) Because there is a 'label' => null entry in the options array. Co-authored-by: cyl3x <[email protected]>
1 parent cf4bbff commit 798d600

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: Fix assert `bin/console state-machine:dump`
3+
issue: NEXT-00000
4+
author: Alexander Menk
5+
author_email: [email protected]
6+
author_github: amenk
7+
---
8+
# Core
9+
* Changed assert in `bin/console state-machine:dump`.

src/Core/System/StateMachine/Util/StateMachineGraphvizDumper.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,10 @@ private function addOptions(array $options): string
172172
$code = [];
173173
foreach ($options as $k => $v) {
174174
\assert(\is_string($k));
175-
\assert(\is_string($v));
176-
$code[] = \sprintf('%s="%s"', $k, $v);
175+
if ($v !== null) {
176+
\assert(\is_scalar($v) || $v instanceof \Stringable);
177+
$code[] = \sprintf('%s="%s"', $k, $v);
178+
}
177179
}
178180

179181
return implode(' ', $code);

0 commit comments

Comments
 (0)