From 29fa086fdefa7f6292d735d11bc4b191374c0df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 18 Oct 2024 19:14:23 +0200 Subject: [PATCH] Set return types to MetadataExtractor --- .../Workflow/Helper/MetadataExtractor.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php index 0774ad10a..71ebe089b 100644 --- a/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php +++ b/src/Bundle/ChillMainBundle/Workflow/Helper/MetadataExtractor.php @@ -25,6 +25,9 @@ class MetadataExtractor private readonly DuplicateEntityWorkflowFinder $duplicateEntityWorkflowFinder, ) {} + /** + * @return list + */ public function availableWorkflowFor(string $relatedEntityClass, ?int $relatedEntityId = 0): array { $blankEntityWorkflow = new EntityWorkflow(); @@ -56,6 +59,9 @@ class MetadataExtractor return $workflowsList; } + /** + * @return array{name: string, text: string} + */ public function buildArrayPresentationForPlace(EntityWorkflow $entityWorkflow, ?EntityWorkflowStep $step = null): array { $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); @@ -69,6 +75,9 @@ class MetadataExtractor return ['name' => $step->getCurrentStep(), 'text' => $text]; } + /** + * @return array{name?: string, text?: string, isForward?: bool} + */ public function buildArrayPresentationForTransition(EntityWorkflow $entityWorkflow, string $transitionName): array { $workflow = $this->registry->get($entityWorkflow, $entityWorkflow->getWorkflowName()); @@ -90,6 +99,9 @@ class MetadataExtractor return []; } + /** + * @return array{name: string, text: string} + */ public function buildArrayPresentationForWorkflow(WorkflowInterface $workflow): array { $metadata = $workflow->getMetadataStore()->getWorkflowMetadata();