2020use Symfony \Component \OptionsResolver \OptionsResolver ;
2121use Symfony \Component \Validator \Constraint ;
2222
23+ /**
24+ * @phpstan-type UiOptions array{
25+ * 'source': ?string,
26+ * 'target': ?string,
27+ * 'entrypoint_type': string,
28+ * 'constraints': Constraint[],
29+ * 'run': 'null|bool',
30+ * 'default': array{'input': mixed, 'context': array{array{'key': 'int|text', 'value':'int|text'}}}
31+ * }
32+ */
2333final readonly class ProcessConfigurationsManager
2434{
2535 public function __construct (private ProcessConfigurationRegistry $ registry )
@@ -39,14 +49,7 @@ public function getPrivateProcesses(): array
3949 }
4050
4151 /**
42- * @return null|array{
43- * 'source': ?string,
44- * 'target': ?string,
45- * 'entrypoint_type': string,
46- * 'constraints': Constraint[],
47- * 'run': 'null|bool',
48- * 'default': array{'input': mixed, 'context': array{array{'key': 'int|text', 'value':'int|text'}}}
49- * }
52+ * @return null|UiOptions
5053 */
5154 public function getUiOptions (string $ processCode ): ?array
5255 {
@@ -62,16 +65,7 @@ public function getUiOptions(string $processCode): ?array
6265 /**
6366 * @param array<int|string, mixed> $options
6467 *
65- * @return array{
66- * 'ui': array{
67- * 'source': ?string,
68- * 'target': ?string,
69- * 'entrypoint_type': string,
70- * 'constraints': Constraint[],
71- * 'run': 'null|bool',
72- * 'default': array{'input': mixed, 'context': array{array{'key': 'int|text', 'value':'int|text'}}}
73- * }
74- * }
68+ * @return array{'ui': UiOptions}
7569 */
7670 private function resolveUiOptions (array $ options ): array
7771 {
@@ -103,16 +97,7 @@ private function resolveUiOptions(array $options): array
10397 $ uiResolver ->setNormalizer ('constraints ' , fn (Options $ options , array $ values ): array => (new ConstraintLoader ())->buildConstraints ($ values ));
10498 });
10599 /**
106- * @var array{
107- * 'ui': array{
108- * 'source': ?string,
109- * 'target': ?string,
110- * 'entrypoint_type': 'text|file',
111- * 'constraints': Constraint[],
112- * 'run': 'null|bool',
113- * 'default': array{'input': mixed, 'context': array{array{'key': 'int|text', 'value':'int|text'}}}
114- * }
115- * } $options
100+ * @var array{'ui': UiOptions} $options
116101 */
117102 $ options = $ resolver ->resolve ($ options );
118103
0 commit comments