From 5861220b48b86b1af2155cf3ae574dee803c08b5 Mon Sep 17 00:00:00 2001 From: Cleopatra Enjeck M Date: Mon, 1 Jul 2024 21:06:33 +0100 Subject: [PATCH] enh: improve formatting, add exception to log Signed-off-by: Cleopatra Enjeck M --- lib/Db/ContextNodeRelationMapper.php | 5 +++-- lib/Service/ContextService.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Db/ContextNodeRelationMapper.php b/lib/Db/ContextNodeRelationMapper.php index 4f949f60b..ad5bdf603 100644 --- a/lib/Db/ContextNodeRelationMapper.php +++ b/lib/Db/ContextNodeRelationMapper.php @@ -33,8 +33,9 @@ public function deleteAllByContextId(int $contextId): void { public function getRelIdsForNode(int $nodeId, int $nodeType): array { $qb = $this->db->getQueryBuilder(); - $qb->select('id')->from($this->table)->where($qb->expr()->eq('node_id', $qb->createNamedParameter($nodeId))) - ->andWhere($qb->expr()->eq('node_type', $qb->createNamedParameter($nodeType))); + $qb->select('id')->from($this->table) + ->where($qb->expr()->eq('node_id', $qb->createNamedParameter($nodeId))) + ->andWhere($qb->expr()->eq('node_type', $qb->createNamedParameter($nodeType))); $result = $qb->executeQuery(); $nodeRelIds = []; while ($row = $result->fetch()) { diff --git a/lib/Service/ContextService.php b/lib/Service/ContextService.php index 368d97753..f427e8271 100644 --- a/lib/Service/ContextService.php +++ b/lib/Service/ContextService.php @@ -270,7 +270,7 @@ public function deleteNodeRel(int $nodeId, int $nodeType): void { } } catch (Exception $e) { - $this->logger->error('something went wrong while deleting node relation for node id: '.(string)$nodeId. ' and node type '.(string)$nodeType); + $this->logger->error('Something went wrong while deleting node relation for node id: ' . (string)$nodeId . ' and node type ' . (string)$nodeType, ['exception' => $e]); } }