Skip to content

Commit

Permalink
try to fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hartmann <[email protected]>
  • Loading branch information
Chartman123 committed Nov 4, 2024
1 parent 91349b6 commit 0096ea0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
9 changes: 6 additions & 3 deletions lib/Db/Question.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@

use OCA\Forms\ResponseDefinitions;
use OCP\AppFramework\Db\Entity;
use stdClass;

/**
* @psalm-import-type FormsQuestionExtraSettings from ResponseDefinitions
* @psalm-import-type FormsQuestionType from ResponseDefinitions
* @method int getFormId()
* @method void setFormId(integer $value)
* @method int getOrder()
* @method void setOrder(integer $value)
* @psalm-method FormsQuestionType getType()
* @method string getType()
* @psalm-method 'date'|'dropdown'|'file'|'long'|'multiple'|'multiple_unique'|'short'|'time' getType()
* @psalm-method 'date'|'datetime'|'dropdown'|'file'|'long'|'multiple'|'multiple_unique'|'short'|'time' getType()
* @method void setType(string $value)
* @psalm-method void setType('date'|'dropdown'|'file'|'long'|'multiple'|'multiple_unique'|'short'|'time' $value)
* @psalm-method void setType('date'|'datetime'|'dropdown'|'file'|'long'|'multiple'|'multiple_unique'|'short'|'time' $value)
* @method bool getIsRequired()
* @method void setIsRequired(bool $value)
* @method string getText()
Expand Down Expand Up @@ -99,7 +102,7 @@ public function setExtraSettings(array $extraSettings) {
* id: int,
* formId: int,
* order: int,
* type: "dropdown"|"multiple"|"multiple_unique"|"date"|"time"|"short"|"long"|"file",
* type: FormsQuestionType,
* isRequired: bool,
* text: string,
* name: string,
Expand Down
2 changes: 1 addition & 1 deletion lib/ResponseDefinitions.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* validationType?: ?string
* }
*
* @psalm-type FormsQuestionType = "dropdown"|"multiple"|"multiple_unique"|"date"|"time"|"short"|"long"|"file"
* @psalm-type FormsQuestionType = "dropdown"|"multiple"|"multiple_unique"|"date"|"time"|"short"|"long"|"file"|"datetime"
*
* @psalm-type FormsQuestion = array{
* id: int,
Expand Down
4 changes: 4 additions & 0 deletions lib/Service/FormsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public function getQuestions(int $formId): array {
}
}

if (empty($question['extraSettings'])) {
$question['extraSettings'] = new \stdClass();
}

$questionList[] = $question;
}
} catch (DoesNotExistException $e) {
Expand Down
3 changes: 2 additions & 1 deletion openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,8 @@
"time",
"short",
"long",
"file"
"file",
"datetime"
]
},
"Share": {
Expand Down

0 comments on commit 0096ea0

Please sign in to comment.