From 5f0053f07d2811fa88641b12a782a049bd7b592c Mon Sep 17 00:00:00 2001 From: Christian Hartmann Date: Mon, 21 Oct 2024 23:35:48 +0200 Subject: [PATCH] fix lint errors Signed-off-by: Christian Hartmann --- lib/Controller/ApiController.php | 21 ++++++++++----------- lib/ResponseDefinitions.php | 5 +++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index 87aa1680f..9bf1f9d74 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -108,7 +108,6 @@ public function __construct( /** * Handle CORS options request by calling parent function */ - // #[ApiRoute(verb: 'OPTIONS', url: '/api/{apiVersion}/{path}', requirements: #[ApiRoute(verb: 'OPTIONS', url: '/api/{apiVersion}/{path}', requirements: [ 'apiVersion' => 'v3', 'path' => '.+' @@ -121,11 +120,11 @@ public function preflightedCors() { // Forms /** * Get all forms available to the user (owned/shared) - * + * * @param string $type The type of forms to retrieve. Defaults to `owned`. - * Possible values: - * - `owned`: Forms owned by the user. - * - `shared`: Forms shared with the user. + * Possible values: + * - `owned`: Forms owned by the user. + * - `shared`: Forms shared with the user. * @return DataResponse, Http::STATUS_PARTIAL_CONTENT, array<>> * @throws OCSBadRequestException wrong Form type supplied */ @@ -136,7 +135,7 @@ public function preflightedCors() { url: '/api/{apiVersion}/forms', requirements: [ 'apiVersion' => 'v3' - ])] + ])] public function getForms(string $type = 'owned'): DataResponse { $result = []; @@ -170,7 +169,7 @@ public function getForms(string $type = 'owned'): DataResponse { url: '/api/{apiVersion}/forms', requirements: [ 'apiVersion' => 'v3' - ])] + ])] public function newForm(?int $fromId = null): DataResponse { // Check if user is allowed if (!$this->configService->canCreateForms()) { @@ -252,7 +251,7 @@ public function newForm(?int $fromId = null): DataResponse { requirements: [ 'apiVersion' => 'v3', 'formId' => '\d+' - ])] + ])] public function getForm(int $formId): DataResponse { try { $form = $this->formMapper->findById($formId); @@ -289,7 +288,7 @@ public function getForm(int $formId): DataResponse { requirements: [ 'apiVersion' => 'v3', 'formId' => '\d+' - ])] + ])] public function updateForm(int $formId, array $keyValuePairs): DataResponse { $this->logger->debug('Updating form: formId: {formId}, values: {keyValuePairs}', [ 'formId' => $formId, @@ -372,7 +371,7 @@ public function updateForm(int $formId, array $keyValuePairs): DataResponse { * @param int $formId the form id * @return DataResponse> * @throws OCSForbiddenException User is not allowed to delete the form - * @throws OCSNotFoundException Form not found + * @throws OCSNotFoundException Form not found */ #[CORS()] #[NoAdminRequired()] @@ -382,7 +381,7 @@ public function updateForm(int $formId, array $keyValuePairs): DataResponse { requirements: [ 'apiVersion' => 'v3', 'formId' => '\d+' - ])] + ])] public function deleteForm(int $formId): DataResponse { $this->logger->debug('Delete Form: {formId}', [ 'formId' => $formId, diff --git a/lib/ResponseDefinitions.php b/lib/ResponseDefinitions.php index 486caf342..2d2cd414a 100644 --- a/lib/ResponseDefinitions.php +++ b/lib/ResponseDefinitions.php @@ -21,7 +21,7 @@ * */ - namespace OCA\Forms; +namespace OCA\Forms; /** * @psalm-type FormsForm = array{ @@ -53,4 +53,5 @@ * "state": int * } */ -class ResponseDefinitions {} \ No newline at end of file +class ResponseDefinitions { +}