{"record":{"id":"eeeaa4fa2ed2cc03","repo":"symfony/symfony","slug":"the-from-arcs-must-be-a-list-of-strings-or-array","errorCode":null,"errorMessage":"The \"from\" arcs must be a list of strings or arrays in workflow configuration.","messagePattern":"The \"from\" arcs must be a list of strings or arrays in workflow configuration\\.","errorType":"validation","errorClass":"InvalidConfigurationException","httpStatus":null,"severity":"error","filePath":"src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php","lineNumber":676,"sourceCode":"                                                    ->beforeNormalization()\n                                                        ->ifArray()\n                                                        ->then($workflowNormalizeArcs = static function ($arcs) {\n                                                            // Fix XML parsing, when only one arc is defined\n                                                            if (\\array_key_exists('value', $arcs) && \\array_key_exists('weight', $arcs)) {\n                                                                $arcs = [[\n                                                                    'place' => $arcs['value'],\n                                                                    'weight' => $arcs['weight'],\n                                                                ]];\n                                                            } elseif (\\array_key_exists('place', $arcs)) {\n                                                                $arcs = [$arcs];\n                                                            }\n\n                                                            $normalizedArcs = [];\n                                                            foreach ($arcs as $arc) {\n                                                                if (\\is_string($arc) || $arc instanceof \\BackedEnum) {\n                                                                    $arc = ['place' => $arc];\n                                                                } elseif (!\\is_array($arc)) {\n                                                                    throw new InvalidConfigurationException('The \"from\" arcs must be a list of strings or arrays in workflow configuration.');\n                                                                } elseif (\\array_key_exists('value', $arc) && \\array_key_exists('weight', $arc)) {\n                                                                    // Fix XML parsing\n                                                                    $arc = [\n                                                                        'place' => $arc['value'],\n                                                                        'weight' => $arc['weight'],\n                                                                    ];\n                                                                }\n\n                                                                if (($arc['place'] ?? null) instanceof \\BackedEnum) {\n                                                                    $arc['place'] = $arc['place']->value;\n                                                                }\n\n                                                                $normalizedArcs[] = $arc;\n                                                            }\n\n                                                            return $normalizedArcs;\n                                                        })\n                                                    ->end()","sourceCodeStart":658,"sourceCodeEnd":694,"githubUrl":"https://github.com/symfony/symfony/blob/698e28026c22cf35d032cdb6e800db48b1535790/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L658-L694","documentation":"Thrown by the workflow arc normalizer (used for both `from` and `to`) when an element of the list is neither a string, a BackedEnum, nor an array. Arcs must describe a place (string/enum) or a place+weight structure (array), so any other type is rejected.","triggerScenarios":"Setting a transition's `from: [123]` (integer), `from: [null]`, or `from: [{ nested: { deep: x } }]` (non-place array) where an element is an unsupported type.","commonSituations":"YAML quoting issue turning a place name into a non-string; accidentally nesting arrays; config generated programmatically producing ints/nulls; malformed XML.","solutions":["Ensure every `from`/`to` element is a place name string, a BackedEnum, or an array with a `place` key.","Quote place names in YAML if they could parse as numbers/booleans.","For weighted arcs use `[{ place: <name>, weight: <int> }]`."],"exampleFix":"// before - integer place name\nframework:\n    workflows:\n        order:\n            transitions:\n                pay: { from: [1], to: [2] }\n\n// after - string place names\nframework:\n    workflows:\n        order:\n            transitions:\n                pay: { from: ['1', '2'], to: ['paid'] }\n\n// or weighted arc\nframework:\n    workflows:\n        order:\n            transitions:\n                pay: { from: [{ place: pending, weight: 1 }], to: [paid] }","handlingStrategy":"type-guard","validationCode":"// Validate each arc is a string, BackedEnum, or a place-array\nforeach ($arcs as $arc) {\n    if (!is_string($arc) && !$arc instanceof \\BackedEnum && !is_array($arc)) {\n        throw new \\InvalidArgumentException('Each \"from\"/\"to\" arc must be a string, BackedEnum, or array.');\n    }\n}","typeGuard":"function isValidArc(mixed $arc): bool\n{\n    return is_string($arc) || $arc instanceof \\BackedEnum || (is_array($arc) && isset($arc['place']));\n}","tryCatchPattern":null,"preventionTips":["Quote place names in YAML so they are not parsed as ints/bools.","Use BackedEnum values or explicit arrays for weighted arcs.","Lint workflow YAML in CI to catch malformed arcs early."],"tags":["workflow","configuration","validation"],"analyzedSha":"698e28026c22cf35d032cdb6e800db48b1535790","analyzedAt":"2026-08-06T23:40:49.025Z","schemaVersion":2},"datasetVersion":"2026-08-07T03:17:09.362Z"}