@@ -34,10 +34,9 @@ public static function fromLegacyConfiguration(array $configuration): DTO\Workfl
3434 $ configuration ['code ' ] ?? sprintf ('workflow%s ' , $ random ),
3535 new DTO \JobList (
3636 ...array_map (
37- function (array $ config , int $ order ) {
37+ function (string $ code , array $ config , int $ order ) {
3838 if (\array_key_exists ('pipeline ' , $ config )) {
3939 $ name = $ config ['pipeline ' ]['name ' ] ?? sprintf ('pipeline%d ' , $ order );
40- $ code = $ config ['pipeline ' ]['code ' ] ?? sprintf ('pipeline%d ' , $ order );
4140 unset($ config ['pipeline ' ]['name ' ], $ config ['pipeline ' ]['code ' ]);
4241
4342 array_walk_recursive ($ config , function (&$ value ): void {
@@ -50,13 +49,14 @@ function (array $config, int $order) {
5049 $ name ,
5150 new JobCode ($ code ),
5251 new StepList (
53- ...array_map (fn ( array $ step , int $ order ) => new Step (
52+ ...array_map (fn ( string $ code , array $ step , int $ order ) => new Step (
5453 $ step ['name ' ] ?? sprintf ('step%d ' , $ order ),
55- new StepCode ($ step [ ' code ' ] ?? sprintf ('step%d ' , $ order )),
54+ new StepCode ($ code ?? sprintf ('step%d ' , $ order )),
5655 $ step ,
5756 new ProbeList (),
5857 $ order
5958 ),
59+ array_keys ($ config ['pipeline ' ]['steps ' ]),
6060 $ config ['pipeline ' ]['steps ' ],
6161 range (0 , (is_countable ($ config ['pipeline ' ]['steps ' ]) ? \count ($ config ['pipeline ' ]['steps ' ]) : 0 ) - 1 )
6262 ),
@@ -67,7 +67,6 @@ function (array $config, int $order) {
6767
6868 if (\array_key_exists ('action ' , $ config )) {
6969 $ name = $ config ['action ' ]['name ' ] ?? sprintf ('action%d ' , $ order );
70- $ code = $ config ['action ' ]['code ' ] ?? sprintf ('action%d ' , $ order );
7170 unset($ config ['action ' ]['name ' ], $ config ['action ' ]['code ' ]);
7271
7372 array_walk_recursive ($ config , function (&$ value ): void {
@@ -90,8 +89,9 @@ function (array $config, int $order) {
9089
9190 throw new \RuntimeException ('This type is currently not supported. ' );
9291 },
92+ array_keys ($ configuration ['workflow ' ]['jobs ' ]),
9393 $ configuration ['workflow ' ]['jobs ' ],
94- range (0 , (is_countable ($ configuration ['workflow ' ]['jobs ' ]) ? \count ($ configuration ['workflow ' ]['jobs ' ]) : 0 ) - 1 )
94+ range (0 , (is_countable ($ configuration ['workflow ' ]['jobs ' ]) ? \count ($ configuration ['workflow ' ]['jobs ' ]) : 0 ) - 1 ),
9595 )
9696 ),
9797 new Composer (
0 commit comments