Skip to content

chore: make Forms OpenAPI compliant #15

chore: make Forms OpenAPI compliant

chore: make Forms OpenAPI compliant #15

Triggered via pull request October 28, 2024 18:53
Status Failure
Total duration 2m 16s
Artifacts

psalm-matrix.yml

on: pull_request
Matrix: static-analysis
static-psalm-analysis-summary
4s
static-psalm-analysis-summary
Fit to window
Zoom out
Zoom in

Annotations

11 errors
InvalidReturnType: lib/Controller/ApiController.php#L456
lib/Controller/ApiController.php:456:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<201, array{accept: array<array-key, string>, description: string, extraSettings: array{allowOtherAnswer?: bool|null, allowedFileExtensions?: array<array-key, string>|null, allowedFileTypes?: array<array-key, string>|null, maxAllowedFilesCount?: int|null, maxFileSize?: int|null, optionsLimitMax?: int|null, optionsLimitMin?: int|null, shuffleOptions?: bool|null, validationRegex?: null|string, validationType?: null|string}, formId: int, id: int, isRequired: bool, name: string, options: array<array-key, array{id: int, order: int|null, questionId: int, text: string}>, order: int, text: string, type: string}, array<never, never>>' for OCA\Forms\Controller\ApiController::newQuestion is incorrect, got 'OCP\AppFramework\Http\DataResponse<201, array{accept: array<never, never>, options: list<array<array-key, mixed>>, ...<array-key, mixed>}, array<never, never>>' (see https://psalm.dev/011)
InvalidReturnStatement: lib/Controller/ApiController.php#L558
lib/Controller/ApiController.php:558:10: InvalidReturnStatement: The inferred type 'OCP\AppFramework\Http\DataResponse<201, array{accept: array<never, never>, options: list<array<array-key, mixed>>, ...<array-key, mixed>}, array<never, never>>' does not match the declared return type 'OCP\AppFramework\Http\DataResponse<201, array{accept: array<array-key, string>, description: string, extraSettings: array{allowOtherAnswer?: bool|null, allowedFileExtensions?: array<array-key, string>|null, allowedFileTypes?: array<array-key, string>|null, maxAllowedFilesCount?: int|null, maxFileSize?: int|null, optionsLimitMax?: int|null, optionsLimitMin?: int|null, shuffleOptions?: bool|null, validationRegex?: null|string, validationType?: null|string}, formId: int, id: int, isRequired: bool, name: string, options: array<array-key, array{id: int, order: int|null, questionId: int, text: string}>, order: int, text: string, type: string}, array<never, never>>' for OCA\Forms\Controller\ApiController::newQuestion (see https://psalm.dev/128)
InvalidReturnType: lib/Controller/ApiController.php#L707
lib/Controller/ApiController.php:707:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<200, array<string, int>, array<never, never>>' for OCA\Forms\Controller\ApiController::reorderQuestions is incorrect, got 'OCP\AppFramework\Http\DataResponse<200, array<int, array{order: int}>, array<never, never>>' (see https://psalm.dev/011)
InvalidOperand: lib/Controller/ApiController.php#L779
lib/Controller/ApiController.php:779:22: InvalidOperand: Cannot perform a numeric operation with a non-numeric type string (see https://psalm.dev/058)
InvalidOperand: lib/Controller/ApiController.php#L781
lib/Controller/ApiController.php:781:37: InvalidOperand: Cannot perform a numeric operation with a non-numeric type string (see https://psalm.dev/058)
InvalidReturnStatement: lib/Controller/ApiController.php#L796
lib/Controller/ApiController.php:796:10: InvalidReturnStatement: The inferred type 'OCP\AppFramework\Http\DataResponse<200, array<int, array{order: int}>, array<never, never>>' does not match the declared return type 'OCP\AppFramework\Http\DataResponse<200, array<string, int>, array<never, never>>' for OCA\Forms\Controller\ApiController::reorderQuestions (see https://psalm.dev/128)
TypeDoesNotContainType: lib/Controller/ApiController.php#L927
lib/Controller/ApiController.php:927:7: TypeDoesNotContainType: 2 cannot be identical to 0 (see https://psalm.dev/056)
TypeDoesNotContainType: lib/Controller/ApiController.php#L927
lib/Controller/ApiController.php:927:7: TypeDoesNotContainType: Type array{key: string, value: mixed} for $keyValuePairs is always !non-empty-countable (see https://psalm.dev/056)
InvalidReturnType: lib/Controller/ApiController.php#L1012
lib/Controller/ApiController.php:1012:13: InvalidReturnType: The declared return type 'OCP\AppFramework\Http\DataResponse<200, array<string, int>, array<never, never>>' for OCA\Forms\Controller\ApiController::reorderOptions is incorrect, got 'OCP\AppFramework\Http\DataResponse<200, array<numeric-string, array{order: int}>, array<never, never>>' (see https://psalm.dev/011)
InvalidReturnStatement: lib/Controller/ApiController.php#L1101
lib/Controller/ApiController.php:1101:10: InvalidReturnStatement: The inferred type 'OCP\AppFramework\Http\DataResponse<200, array<numeric-string, array{order: int}>, array<never, never>>' does not match the declared return type 'OCP\AppFramework\Http\DataResponse<200, array<string, int>, array<never, never>>' for OCA\Forms\Controller\ApiController::reorderOptions (see https://psalm.dev/128)
static-psalm-analysis-summary
Process completed with exit code 1.