File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -381,19 +381,25 @@ public function getDescription(): string {
381381 }
382382
383383 public function getInputShape (): array {
384- return array_map (static fn (array $ shape ) => new ShapeDescriptor (
385- $ shape ['name ' ],
386- $ shape ['description ' ],
387- EShapeType::from ($ shape ['type ' ]),
388- ), $ this ->customTaskType ['input_shape ' ]);
384+ return array_reduce ($ this ->customTaskType ['input_shape ' ], static function (array $ input , array $ shape ) {
385+ $ input [$ shape ['name ' ]] = new ShapeDescriptor (
386+ $ shape ['name ' ],
387+ $ shape ['description ' ],
388+ EShapeType::from ($ shape ['shape_type ' ]),
389+ );
390+ return $ input ;
391+ }, []);
389392 }
390393
391394 public function getOutputShape (): array {
392- return array_map (static fn (array $ shape ) => new ShapeDescriptor (
393- $ shape ['name ' ],
394- $ shape ['description ' ],
395- EShapeType::from ($ shape ['type ' ]),
396- ), $ this ->customTaskType ['output_shape ' ]);
395+ return array_reduce ($ this ->customTaskType ['output_shape ' ], static function (array $ output , array $ shape ) {
396+ $ output [$ shape ['name ' ]] = new ShapeDescriptor (
397+ $ shape ['name ' ],
398+ $ shape ['description ' ],
399+ EShapeType::from ($ shape ['shape_type ' ]),
400+ );
401+ return $ output ;
402+ }, []);
397403 }
398404 };
399405 }
You can’t perform that action at this time.
0 commit comments