You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#21271 [Workflow] Added new validator to make sure each place has unique translation names (Nyholm)
This PR was submitted for the master branch but it was merged into the 3.2 branch instead (closessymfony#21271).
Discussion
----------
[Workflow] Added new validator to make sure each place has unique translation names
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | n/a
A definition where a place that has transitions with the same name is an invalid definition.
```yaml
invalid1:
places: ['a', 'b', 'c']
transitions:
t1:
from: a
to: b
t1:
from: a
to: c
valid1:
places: ['a', 'b', 'c']
transitions:
t1:
from: a
to: b
t2:
from: a
to: c
valid2:
places: ['a', 'b', 'c']
transitions:
t1:
from: a
to: b
t1:
from: b
to: c
valid3:
places: ['a', 'b', 'c', 'd']
transitions:
t1:
from: ['a', 'b']
to: d
t2:
from: ['a', 'b']
to: c
```
FYI @lyrixx
Commits
-------
eece8ad [Workflow] Added new validator to make sure each place has unique translation names
* @expectedExceptionMessage All transitions for a place must have an unique name. Multiple transitions named "t1" where found for place "a" in workflow "foo".
if (in_array($transition->getName(), $places[$from])) {
39
+
thrownewInvalidDefinitionException(sprintf('All transitions for a place must have an unique name. Multiple transitions named "%s" where found for place "%s" in workflow "%s".', $transition->getName(), $from, $name));
0 commit comments