Skip to content

Commit

Permalink
Pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
WilcoLouwerse committed Dec 19, 2024
1 parent b2a4b21 commit 8b51f89
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/Controller/EndpointsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace OCA\OpenConnector\Controller;

use Exception;
use OCA\OpenConnector\Exception\AuthenticationException;
use OCA\OpenConnector\Service\AuthorizationService;
use OCA\OpenConnector\Service\ObjectService;
Expand Down Expand Up @@ -123,7 +124,7 @@ public function create(): JSONResponse
}
}

if (isset($data['id'])) {
if (isset($data['id']) === true) {
unset($data['id']);
}

Expand All @@ -140,7 +141,7 @@ public function create(): JSONResponse
* @NoAdminRequired
* @NoCSRFRequired
*
* @param string $id The ID of the endpoint to update
* @param int $id The ID of the endpoint to update
* @return JSONResponse A JSON response containing the updated endpoint details
*/
public function update(int $id): JSONResponse
Expand All @@ -152,7 +153,7 @@ public function update(int $id): JSONResponse
unset($data[$key]);
}
}
if (isset($data['id'])) {
if (isset($data['id']) === true) {
unset($data['id']);
}

Expand All @@ -169,8 +170,9 @@ public function update(int $id): JSONResponse
* @NoAdminRequired
* @NoCSRFRequired
*
* @param string $id The ID of the endpoint to delete
* @param int $id The ID of the endpoint to delete
* @return JSONResponse An empty JSON response
* @throws \OCP\DB\Exception
*/
public function destroy(int $id): JSONResponse
{
Expand All @@ -189,8 +191,9 @@ public function destroy(int $id): JSONResponse
* @NoCSRFRequired
* @PublicPage
*
* @param string $path The request path to match
* @param string $_path
* @return JSONResponse The response from the endpoint service or 404 if no match
* @throws Exception
*/
public function handlePath(string $_path): JSONResponse
{
Expand Down

0 comments on commit 8b51f89

Please sign in to comment.