Skip to content

Commit

Permalink
fix(TaskProcessingService): Custom task type i/o shapes were broken
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr authored Dec 3, 2024
1 parent 7dc96a5 commit 4bc5af2
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions lib/Service/ProvidersAI/TaskProcessingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,19 +381,25 @@ public function getDescription(): string {
}

public function getInputShape(): array {
return array_map(static fn (array $shape) => new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
), $this->customTaskType['input_shape']);
return array_reduce($this->customTaskType['input_shape'], static function (array $input, array $shape) => {

Check failure on line 384 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:384:108: ParseError: Syntax error, unexpected T_DOUBLE_ARROW, expecting '{' on line 384 (see https://psalm.dev/173)
$input[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $input;
}, []);

Check failure on line 391 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:391:6: ParseError: Syntax error, unexpected ',' on line 391 (see https://psalm.dev/173)
}

public function getOutputShape(): array {
return array_map(static fn (array $shape) => new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
), $this->customTaskType['output_shape']);
return array_reduce($this->customTaskType['output_shape'], static function (array $output, array $shape) => {

Check failure on line 395 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:395:110: ParseError: Syntax error, unexpected T_DOUBLE_ARROW, expecting '{' on line 395 (see https://psalm.dev/173)
$output[$shape['name']] = new ShapeDescriptor(
$shape['name'],
$shape['description'],
EShapeType::from($shape['shape_type']),
);
return $output;
}, []);

Check failure on line 402 in lib/Service/ProvidersAI/TaskProcessingService.php

View workflow job for this annotation

GitHub Actions / php-psalm-analysis (8.1)

ParseError

lib/Service/ProvidersAI/TaskProcessingService.php:402:6: ParseError: Syntax error, unexpected ',' on line 402 (see https://psalm.dev/173)
}
};
}
Expand Down

0 comments on commit 4bc5af2

Please sign in to comment.