From 345d3ce1cd61d2d674e41d0be7709fe6b4bf6c68 Mon Sep 17 00:00:00 2001 From: Robert Zondervan Date: Mon, 9 Dec 2024 16:27:25 +0100 Subject: [PATCH] Fix dev --> main PR comments --- lib/Controller/AttachmentsController.php | 2 +- lib/Controller/CatalogiController.php | 4 ++-- lib/Controller/OrganizationsController.php | 6 +++--- lib/Controller/PublicationTypesController.php | 6 +++--- lib/Controller/PublicationsController.php | 4 ++-- lib/Controller/ThemesController.php | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/Controller/AttachmentsController.php b/lib/Controller/AttachmentsController.php index e4098d3c..ffb8160a 100644 --- a/lib/Controller/AttachmentsController.php +++ b/lib/Controller/AttachmentsController.php @@ -133,7 +133,7 @@ public function create(ObjectService $objectService): JSONResponse $object = $this->objectService->saveObject('attachment', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } diff --git a/lib/Controller/CatalogiController.php b/lib/Controller/CatalogiController.php index 8f10c71c..23d43adf 100644 --- a/lib/Controller/CatalogiController.php +++ b/lib/Controller/CatalogiController.php @@ -33,7 +33,7 @@ class CatalogiController extends Controller * @param CatalogMapper $catalogMapper The catalog mapper * @param ObjectService $objectService The object service * @param DirectoryService $directoryService The directory service - * @param BroadcastService $broadcastService The broadcast service + * @param BroadcastService $broadcastService The broadcast service * @param IURLGenerator $urlGenerator The URL generator */ public function __construct( @@ -118,7 +118,7 @@ public function create(ObjectService $objectService): JSONResponse $object = $this->objectService->saveObject('catalog', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } diff --git a/lib/Controller/OrganizationsController.php b/lib/Controller/OrganizationsController.php index 522f3b7e..9ee1f6c1 100644 --- a/lib/Controller/OrganizationsController.php +++ b/lib/Controller/OrganizationsController.php @@ -25,7 +25,7 @@ class OrganizationsController extends Controller * @param IRequest $request The request object * @param IAppConfig $config The app configuration * @param OrganizationMapper $organizationMapper The organization mapper - * @param ObjectService $objectService The object service + * @param ObjectService $objectService The object service * @param IURLGenerator $urlGenerator The URL generator */ public function __construct( @@ -112,7 +112,7 @@ public function create(): JSONResponse $object = $this->objectService->saveObject('organization', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } @@ -145,7 +145,7 @@ public function update(string|int $id): JSONResponse // If we do not have an uri, we need to generate one $data['uri'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute('openCatalogi.organizations.show', ['id' => $data['id']])); - + // Save the updated organization object $object = $this->objectService->saveObject('organization', $data); diff --git a/lib/Controller/PublicationTypesController.php b/lib/Controller/PublicationTypesController.php index e363e52f..ee90e82f 100644 --- a/lib/Controller/PublicationTypesController.php +++ b/lib/Controller/PublicationTypesController.php @@ -121,7 +121,7 @@ public function create(): JSONResponse $object = $this->objectService->saveObject('publicationType', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } @@ -157,7 +157,7 @@ public function update(string|int $id): JSONResponse // If we do not have an uri, we need to generate one $data['uri'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute('openCatalogi.publicationTypes.show', ['id' => $data['id']])); - + // Save the updated publication type object $object = $this->objectService->saveObject('publicationType', $data); @@ -186,7 +186,7 @@ public function destroy(string|int $id): JSONResponse // Return the result as a JSON response return new JSONResponse(['success' => $result], $result === true ? '200' : '404'); } - + /** * Synchronize or delete a publication type based on listing status * diff --git a/lib/Controller/PublicationsController.php b/lib/Controller/PublicationsController.php index 143b5d4b..5a770793 100644 --- a/lib/Controller/PublicationsController.php +++ b/lib/Controller/PublicationsController.php @@ -51,7 +51,7 @@ class PublicationsController extends Controller * @param DownloadService $downloadService The download service * @param ObjectService $objectService The object service * @param IURLGenerator $urlGenerator The URL generator - * + * */ public function __construct ( @@ -202,7 +202,7 @@ public function create(ObjectService $objectService): JSONResponse $object = $this->objectService->saveObject('publication', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } diff --git a/lib/Controller/ThemesController.php b/lib/Controller/ThemesController.php index 80b55864..b5233943 100644 --- a/lib/Controller/ThemesController.php +++ b/lib/Controller/ThemesController.php @@ -100,10 +100,10 @@ public function create(): JSONResponse $object = $this->objectService->saveObject('theme', $data); // If object is a class change it to array - if (is_object($object)) { + if (is_object($object) === true) { $object = $object->jsonSerialize(); } - + // If we do not have an uri, we need to generate one if (isset($object['uri']) === false) { $object['uri'] = $this->urlGenerator->getAbsoluteURL($$this->urlGenerator->linkToRoute('openCatalogi.themes.show', ['id' => $object['id']])); @@ -129,7 +129,7 @@ public function update(string|int $id): JSONResponse $data = $this->request->getParams(); // Ensure the ID in the data matches the ID in the URL - $data['id'] = $id; + $data['id'] = $id; // If we do not have an uri, we need to generate one $data['uri'] = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkToRoute('openCatalogi.themes.show', ['id' => $data['id']]));