Skip to content

Commit 0b4f8c2

Browse files
authored
Fix FormSubmissionServiceInterface::create usage (#2511)
* FormSubmissionCommand.php: both identifier & id are needed * phpstan-baseline.neon: rm FormSubmissionCommandInterface::create ignore
1 parent 61fe28f commit 0b4f8c2

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4040

4141
$formValue = $content->getFieldValue('form', 'eng-GB')->getFormValue();
4242
$data = [
43-
['identifier' => 'single_line', 'name' => 'Line', 'value' => 'The name'],
44-
['identifier' => 'number', 'name' => 'Number', 'value' => 123],
45-
['identifier' => 'checkbox', 'name' => 'Checkbox', 'value' => 0],
43+
['id' => 7, 'identifier' => 'single_line', 'name' => 'Line', 'value' => 'The name'],
44+
['id' => 8, 'identifier' => 'number', 'name' => 'Number', 'value' => 123],
45+
['id' => 9, 'identifier' => 'checkbox', 'name' => 'Checkbox', 'value' => 0],
4646
];
4747

4848
$this->formSubmissionService->create(

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ parameters:
7070
count: 1
7171
path: code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php
7272

73-
-
74-
message: "#^Parameter \\#4 \\$data of method Ibexa\\\\Contracts\\\\FormBuilder\\\\FormSubmission\\\\FormSubmissionServiceInterface\\:\\:create\\(\\) expects array\\<array\\{id\\: int, identifier\\: string, name\\: string, value\\: mixed\\}\\>, array\\{array\\{identifier\\: 'single_line', name\\: 'Line', value\\: 'The name'\\}, array\\{identifier\\: 'number', name\\: 'Number', value\\: 123\\}, array\\{identifier\\: 'checkbox', name\\: 'Checkbox', value\\: 0\\}\\} given\\.$#"
75-
count: 1
76-
path: code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php
77-
7873
-
7974
message: "#^Parameter \\#1 \\$messages of method Symfony\\\\Component\\\\Console\\\\Output\\\\OutputInterface\\:\\:writeln\\(\\) expects iterable\\<string\\>\\|string, string\\|null given\\.$#"
8075
count: 2

0 commit comments

Comments
 (0)