Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php declare(strict_types=1);

Check failure on line 1 in code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php

View workflow job for this annotation

GitHub Actions / Validate code samples (8.3)

Ignored error pattern #^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\.$# in path /home/runner/work/documentation-developer/documentation-developer/code_samples/api/public_php_api/src/Command/FormSubmissionCommand.php was not matched in reported errors.

namespace App\Command;

Expand Down Expand Up @@ -40,9 +40,9 @@

$formValue = $content->getFieldValue('form', 'eng-GB')->getFormValue();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

foreach ($formValue->getFields() as $field) {dump($field->getId(), $field->getIdentifier(), $field->getName());} showed me what to use while testing this command for real.

$data = [
['identifier' => 'single_line', 'name' => 'Line', 'value' => 'The name'],
['identifier' => 'number', 'name' => 'Number', 'value' => 123],
['identifier' => 'checkbox', 'name' => 'Checkbox', 'value' => 0],
['id' => 7, 'identifier' => 'single_line', 'name' => 'Line', 'value' => 'The name'],
['id' => 8, 'identifier' => 'number', 'name' => 'Number', 'value' => 123],
['id' => 9, 'identifier' => 'checkbox', 'name' => 'Checkbox', 'value' => 0],
];

$this->formSubmissionService->create(
Expand Down
Loading