Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,9 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
->defaultValue([])
->prototype('scalar')->end()
->end()
->variableNode('events_to_dispatch')
->defaultValue(null)
->arrayNode('events_to_dispatch')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an arrayNode must use either ->children or prototype for it to work fine (otherwise, it will be an array node using children() but with no allowed children, which is useless)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, once you change that to a proper prototype, the validate function can then be moved to the prototype instead of looping over the array, which would report the invalid value to a more precise location

->validate()
->ifTrue(function ($v) {
if (null === $v) {
return false;
}
if (!\is_array($v)) {
return true;
}
Expand Down