Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <[email protected]>
  • Loading branch information
Chartman123 committed Oct 28, 2024
1 parent cfcde6b commit 3ac4283
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,9 @@ public function reorderOptions(int $formId, int $questionId, array $newOrder) {
$oldOrder = $options[$arrayKey]->getOrder();

// Only set order, if it changed.
if ($oldOrder !== $arrayKey + 1) {
if ($oldOrder !== (int)$arrayKey + 1) {

Check warning on line 1084 in lib/Controller/ApiController.php

View check run for this annotation

Codecov / codecov/patch

lib/Controller/ApiController.php#L1084

Added line #L1084 was not covered by tests
// Set Order. ArrayKey counts from zero, order counts from 1.
$options[$arrayKey]->setOrder($arrayKey + 1);
$options[$arrayKey]->setOrder((int)$arrayKey + 1);

Check warning on line 1086 in lib/Controller/ApiController.php

View check run for this annotation

Codecov / codecov/patch

lib/Controller/ApiController.php#L1086

Added line #L1086 was not covered by tests
}
}

Expand Down
16 changes: 8 additions & 8 deletions lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
* isRequired: bool,
* text: string,
* name: string,
* options: array<FormsOption>,
* options: list<FormsOption>,
* accept: string[],
* extraSettings: \stdClass
* extraSettings: array<string, string>
* }
*
* @psalm-type FormsAnswer = array{
Expand All @@ -66,13 +66,13 @@
* formId: int,
* userId: string,
* timestamp: int,
* answers: array<FormsAnswer>,
* answers: list<FormsAnswer>,
* userDisplayName: string
* }
*
* @psalm-type FormsSubmissions = array{
* submissions: array<FormsSubmission>,
* questions: array<FormsQuestion>
* submissions: list<FormsSubmission>,
* questions: list<FormsQuestion>
* }
*
* @psalm-type FormsForm = array{
Expand All @@ -82,17 +82,17 @@
* description: string,
* ownerId: string,
* created: int,
* access: \stdClass,
* access: string[],
* expires: int,
* isAnonymous: bool,
* submitMultiple: bool,
* showExpiration: bool,
* canSubmit: bool,
* permissions: string[],
* questions: array<FormsQuestion>,
* questions: list<FormsQuestion>,
* state: int,
* shares: string[],
* submissions: array<FormsSubmission>,
* submissions: list<FormsSubmission>,
* }
*
* @psalm-type FormsUploadedFile = array{
Expand Down
10 changes: 7 additions & 3 deletions openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@
"format": "int64"
},
"access": {
"type": "object",
"additionalProperties": true
"type": "array",
"items": {
"type": "string"
}
},
"expires": {
"type": "integer",
Expand Down Expand Up @@ -309,7 +311,9 @@
},
"extraSettings": {
"type": "object",
"additionalProperties": true
"additionalProperties": {
"type": "string"
}
}
}
},
Expand Down

0 comments on commit 3ac4283

Please sign in to comment.