@@ -127,7 +127,7 @@ public function preflightedCors() {
127
127
* Possible values:
128
128
* - `owned`: Forms owned by the user.
129
129
* - `shared`: Forms shared with the user.
130
- * @return DataResponse<array<FormsPartialForm>, Http::STATUS_OK, array<> >
130
+ * @return DataResponse<Http::STATUS_OK, array<FormsPartialForm>, array{} >
131
131
* @throws OCSBadRequestException wrong form type supplied
132
132
*/
133
133
#[CORS ()]
@@ -156,7 +156,7 @@ public function getForms(string $type = 'owned'): DataResponse {
156
156
* Return a copy of the form if the parameter $fromId is set
157
157
*
158
158
* @param ?int $fromId (optional) Id of the form that should be cloned
159
- * @return DataResponse<FormsForm, Http::STATUS_CREATED, array<> >
159
+ * @return DataResponse<Http::STATUS_CREATED, FormsForm, array{} >
160
160
* @throws OCSForbiddenException The user is not allowed to create forms
161
161
*/
162
162
#[CORS ()]
@@ -231,7 +231,7 @@ public function newForm(?int $fromId = null): DataResponse {
231
231
* Read all information to edit a Form (form, questions, options, except submissions/answers)
232
232
*
233
233
* @param int $formId Id of the form
234
- * @return DataResponse<array<FormsForm>, Http::STATUS_OK, array<> >
234
+ * @return DataResponse<Http::STATUS_OK, array<FormsForm>, array{} >
235
235
* @throws OCSBadRequestException Could not find form
236
236
* @throws OCSForbiddenException User has no permissions to get this form
237
237
*/
@@ -259,7 +259,7 @@ public function getForm(int $formId): DataResponse {
259
259
*
260
260
* @param int $formId FormId of form to update
261
261
* @param array<string, mixed> $keyValuePairs Array of key=>value pairs to update.
262
- * @return DataResponse<int formId, Http::STATUS_OK, array<> >
262
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
263
263
* @throws OCSBadRequestException Could not find new form owner
264
264
* @throws OCSForbiddenException Empty keyValuePairs provided
265
265
* @throws OCSForbiddenException Not allowed to update id, hash, created, fileId or lastUpdated. OwnerId only allowed if no other key provided.
@@ -349,7 +349,7 @@ public function updateForm(int $formId, array $keyValuePairs): DataResponse {
349
349
* Delete a form
350
350
*
351
351
* @param int $formId the form id
352
- * @return DataResponse<int formId, Http::STATUS_OK, array<> >
352
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
353
353
* @throws OCSForbiddenException User is not allowed to delete the form
354
354
* @throws OCSNotFoundException Form not found
355
355
*/
@@ -372,7 +372,7 @@ public function deleteForm(int $formId): DataResponse {
372
372
* Read all questions (including options)
373
373
*
374
374
* @param int $formId the form id
375
- * @return DataResponse<array<FormQuestion>, Http::STATUS_OK, array<> >
375
+ * @return DataResponse<Http::STATUS_OK, array<FormsQuestion>, array{} >
376
376
* @throws OCSForbiddenException User has no permissions to get this form
377
377
* @throws OCSNotFoundException Could not find form
378
378
*/
@@ -402,7 +402,7 @@ public function getQuestions(int $formId): DataResponse {
402
402
*
403
403
* @param int $formId FormId
404
404
* @param int $questionId QuestionId
405
- * @return DataResponse<FormQuestion, Http::STATUS_OK, array<> >
405
+ * @return DataResponse<Http::STATUS_OK, FormsQuestion, array{} >
406
406
* @throws OCSBadRequestException Question doesn\'t belong to given Form
407
407
* @throws OCSForbiddenException User has no permissions to get this form
408
408
* @throws OCSNotFoundException Could not find form
@@ -439,7 +439,7 @@ public function getQuestion(int $formId, int $questionId): DataResponse {
439
439
* @param string $type the new question type
440
440
* @param string $text the new question title
441
441
* @param ?int $fromId (optional) id of the question that should be cloned
442
- * @return DataResponse<FormQuestion, Http::STATUS_CREATED, array<> >
442
+ * @return DataResponse<Http::STATUS_CREATED, FormsQuestion, array{} >
443
443
* @throws OCSBadRequestException Invalid type
444
444
* @throws OCSBadRequestException Datetime question type no longer supported
445
445
* @throws OCSForbiddenException User has no permissions to get this form
@@ -549,7 +549,7 @@ public function newQuestion(int $formId, ?string $type = null, string $text = ''
549
549
* @param int $formId the form id
550
550
* @param int $questionId id of question to update
551
551
* @param array<string, mixed> $keyValuePairs Array of key=>value pairs to update.
552
- * @return DataResponse<int id, Http::STATUS_OK, array<> >
552
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
553
553
* @throws OCSBadRequestException Question doesn\'t belong to given Form
554
554
* @throws OCSBadRequestException Invalid extraSettings, will not update.
555
555
* @throws OCSForbiddenException Empty keyValuePairs, will not update
@@ -590,7 +590,7 @@ public function updateQuestion(int $formId, int $questionId, array $keyValuePair
590
590
// Don't allow empty array
591
591
if (sizeof ($ keyValuePairs ) === 0 ) {
592
592
$ this ->logger ->info ('Empty keyValuePairs, will not update. ' );
593
- throw new OCSBacRequestException ('This form is archived and can not be modified ' );
593
+ throw new OCSBadRequestException ('This form is archived and can not be modified ' );
594
594
}
595
595
596
596
//Don't allow to change id or formId
@@ -625,7 +625,7 @@ public function updateQuestion(int $formId, int $questionId, array $keyValuePair
625
625
*
626
626
* @param int $formId the form id
627
627
* @param int $questionId the question id
628
- * @return DataResponse<int id, Http::STATUS_OK, array<> >
628
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
629
629
* @throws OCSBadRequestException Question doesn\'t belong to given Form
630
630
* @throws OCSForbiddenException This form is archived and can not be modified
631
631
* @throws OCSForbiddenException User has no permissions to get this form
@@ -684,7 +684,7 @@ public function deleteQuestion(int $formId, int $questionId): DataResponse {
684
684
*
685
685
* @param int $formId Id of the form to reorder
686
686
* @param array<string, int> $newOrder Array of Question-Ids in new order.
687
- * @return DataResponse<array<int, int>, Http::STATUS_OK, array<> >
687
+ * @return DataResponse<Http::STATUS_OK, array<string, int>, array{} >
688
688
* @throws OCSBadRequestException The given array contains duplicates
689
689
* @throws OCSBadRequestException The length of the given array does not match the number of stored questions
690
690
* @throws OCSBadRequestException Question doesn\'t belong to given Form
@@ -782,7 +782,7 @@ public function reorderQuestions(int $formId, array $newOrder): DataResponse {
782
782
* @param int $formId id of the form
783
783
* @param int $questionId id of the question
784
784
* @param array<string> $optionTexts the new option text
785
- * @return DataResponse<array<FormsOption>, Http::STATUS_CREATED, array<> > Returns a DataResponse containing the added options
785
+ * @return DataResponse<Http::STATUS_CREATED, array<FormsOption>, array{} > Returns a DataResponse containing the added options
786
786
* @throws OCSBadRequestException This question is not part ot the given form
787
787
* @throws OCSForbiddenException This form is archived and can not be modified
788
788
* @throws OCSForbiddenException Current user has no permission to edit
@@ -804,7 +804,7 @@ public function newOption(int $formId, int $questionId, array $optionTexts): Dat
804
804
$ this ->logger ->debug ('This form is archived and can not be modified ' );
805
805
throw new OCSForbiddenException ('This form is archived and can not be modified ' );
806
806
}
807
-
807
+
808
808
try {
809
809
$ question = $ this ->questionMapper ->findById ($ questionId );
810
810
} catch (IMapperException $ e ) {
@@ -858,7 +858,7 @@ public function newOption(int $formId, int $questionId, array $optionTexts): Dat
858
858
* @param int $questionId id of question
859
859
* @param int $optionId id of option to update
860
860
* @param array{key: string, value: mixed} $keyValuePairs Array of key=>value pairs to update.
861
- * @return DataResponse<id: int, Http::STATUS_OK, array<> > Returns the id of the updated option
861
+ * @return DataResponse<Http::STATUS_OK, int, array{} > Returns the id of the updated option
862
862
* @throws OCSBadRequestException The given option id doesn't match the question or form
863
863
* @throws OCSForbiddenException This form is archived and can not be modified
864
864
* @throws OCSForbiddenException Current user has no permission to edit
@@ -927,7 +927,7 @@ public function updateOption(int $formId, int $questionId, int $optionId, array
927
927
* @param int $formId id of form
928
928
* @param int $questionId id of question
929
929
* @param int $optionId id of option to update
930
- * @return DataResponse<id: int, Http::STATUS_OK, array<> > Returns the id of the deleted option
930
+ * @return DataResponse<Http::STATUS_OK, int, array{} > Returns the id of the deleted option
931
931
* @throws OCSBadRequestException The given option id doesn't match the question or form
932
932
* @throws OCSForbiddenException This form is archived and can not be modified
933
933
* @throws OCSForbiddenException Current user has no permission to edit
@@ -947,7 +947,7 @@ public function deleteOption(int $formId, int $questionId, int $optionId): DataR
947
947
$ this ->logger ->debug ('This form is archived and can not be modified ' );
948
948
throw new OCSForbiddenException ('This form is archived and can not be modified ' );
949
949
}
950
-
950
+
951
951
try {
952
952
$ option = $ this ->optionMapper ->findById ($ optionId );
953
953
$ question = $ this ->questionMapper ->findById ($ questionId );
@@ -981,7 +981,7 @@ public function deleteOption(int $formId, int $questionId, int $optionId): DataR
981
981
* @param int $formId id of form
982
982
* @param int $questionId id of question
983
983
* @param array<string, int> $newOrder Array of option ids in new order.
984
- * @return DataResponse<array<int, int>, Http::STATUS_OK, array<> >
984
+ * @return DataResponse<Http::STATUS_OK, array<string, int>, array{} >
985
985
* @throws OCSBadRequestException The given question id doesn't match the form
986
986
* @throws OCSBadRequestException The given array contains duplicates
987
987
* @throws OCSBadRequestException The length of the given array does not match the number of stored options
@@ -1018,14 +1018,14 @@ public function reorderOptions(int $formId, int $questionId, array $newOrder) {
1018
1018
$ this ->logger ->debug ('The given array contains duplicates ' );
1019
1019
throw new OCSBadRequestException ('The given array contains duplicates ' );
1020
1020
}
1021
-
1021
+
1022
1022
$ options = $ this ->optionMapper ->findByQuestion ($ questionId );
1023
-
1023
+
1024
1024
if (sizeof ($ options ) !== sizeof ($ newOrder )) {
1025
1025
$ this ->logger ->debug ('The length of the given array does not match the number of stored options ' );
1026
1026
throw new OCSBadRequestException ('The length of the given array does not match the number of stored options ' );
1027
1027
}
1028
-
1028
+
1029
1029
$ options = []; // Clear Array of Entities
1030
1030
$ response = []; // Array of ['optionId' => ['order' => newOrder]]
1031
1031
@@ -1061,13 +1061,13 @@ public function reorderOptions(int $formId, int $questionId, array $newOrder) {
1061
1061
foreach ($ options as $ option ) {
1062
1062
$ this ->optionMapper ->update ($ option );
1063
1063
1064
- $ response [$ option ->getId ()] = [
1064
+ $ response [( string ) $ option ->getId ()] = [
1065
1065
'order ' => $ option ->getOrder ()
1066
1066
];
1067
1067
}
1068
1068
1069
1069
$ this ->formMapper ->update ($ form );
1070
-
1070
+
1071
1071
return new DataResponse ($ response );
1072
1072
}
1073
1073
@@ -1082,7 +1082,7 @@ public function reorderOptions(int $formId, int $questionId, array $newOrder) {
1082
1082
* - `csv`: Comma-separated value
1083
1083
* - `ods`: OpenDocument Spreadsheet
1084
1084
* - `xlsx`: Excel Open XML Spreadsheet
1085
- * @return DataResponse|DataDownloadResponse< FormsSubmissions, Http::STATUS_OK, array<> >
1085
+ * @return DataResponse<Http::STATUS_OK, FormsSubmissions, array{}>|DataDownloadResponse< Http::STATUS_OK, 'text/csv'|'application/vnd.oasis.opendocument.spreadsheet'|'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', array{} >
1086
1086
* @throws OCSNotFoundException Could not find form
1087
1087
* @throws OCSForbiddenException The current user has no permission to get the results for this form
1088
1088
*/
@@ -1143,7 +1143,7 @@ public function getSubmissions(int $formId, ?string $fileFormat = null): DataRes
1143
1143
* Delete all submissions of a specified form
1144
1144
*
1145
1145
* @param int $formId the form id
1146
- * @return DataResponse<int: formId, Http::STATUS_OK, array<> >
1146
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
1147
1147
* @throws OCSNotFoundException Could not find form
1148
1148
* @throws OCSForbiddenException This form is not owned by the current user and user has no `results_delete` permission
1149
1149
*/
@@ -1181,7 +1181,7 @@ public function deleteAllSubmissions(int $formId): DataResponse {
1181
1181
* @param int $formId the form id
1182
1182
* @param array<string, array<string>> $answers [question_id => arrayOfString]
1183
1183
* @param string $shareHash public share-hash -> Necessary to submit on public link-shares.
1184
- * @return DataResponse<array<>, Http::STATUS_CREATED, array<> >
1184
+ * @return DataResponse<Http::STATUS_CREATED, null, array{} >
1185
1185
* @throws OCSBadRequestException At least one submitted answer is not valid
1186
1186
* @throws OCSForbiddenException Already submitted
1187
1187
* @throws OCSForbiddenException Not allowed to access this form
@@ -1280,7 +1280,7 @@ public function newSubmission(int $formId, array $answers, string $shareHash = '
1280
1280
*
1281
1281
* @param int $formId the form id
1282
1282
* @param int $submissionId the submission id
1283
- * @return DataResponse<int: submissionId, Http::STATUS_OK, array<> >
1283
+ * @return DataResponse<Http::STATUS_OK, int, array{} >
1284
1284
* @throws OCSBadRequestException Submission doesn't belong to given form
1285
1285
* @throws OCSNotFoundException Could not find form or submission
1286
1286
* @throws OCSForbiddenException This form is not owned by the current user and user has no `results_delete` permission
@@ -1325,7 +1325,7 @@ public function deleteSubmission(int $formId, int $submissionId): DataResponse {
1325
1325
* @param int $formId of the form
1326
1326
* @param string $path The Cloud-Path to export to
1327
1327
* @param string $fileFormat File format used for export
1328
- * @return DataResponse<string: fileName, Http::STATUS_OK, array<> >
1328
+ * @return DataResponse<Http::STATUS_OK, string, array{} >
1329
1329
* @throws OCSForbiddenException The current user has no permission to get the results for this form
1330
1330
* @throws OCSNotFoundException Could not find form
1331
1331
*/
@@ -1356,7 +1356,7 @@ public function exportSubmissionsToCloud(int $formId, string $path, string $file
1356
1356
* @param int $formId id of the form
1357
1357
* @param int $questionId id of the question
1358
1358
* @param string $shareHash hash of the form share
1359
- * @return DataResponse<FormsUploadedFile, Http::STATUS_OK, array<> >
1359
+ * @return DataResponse<Http::STATUS_OK, FormsUploadedFile, array{} >
1360
1360
* @throws OCSBadRequestException No files provided
1361
1361
* @throws OCSBadRequestException Question doesn't belong to the given form
1362
1362
* @throws OCSBadRequestException Invalid file provided
0 commit comments