Skip to content

Commit 3675b4f

Browse files
authored
Merge pull request #18 from herndlm/fix-row-handling-in-event-comment-mapper
Fix row handling in EventCommentMapper
2 parents 8b4788c + edcae14 commit 3675b4f

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

src/Model/EventCommentMapper.php

+2-13
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function getCommentInfo($comment_id): false|array
250250
*/
251251
$row = $stmt->fetch(PDO::FETCH_ASSOC);
252252

253-
return $row ?: false;
253+
return $row;
254254
}
255255

256256
/**
@@ -317,18 +317,7 @@ public function getReportedCommentsByEventId(int $event_id, bool $moderated = fa
317317
. " and ec.ID = :comment_id";
318318
$comment_stmt = $this->_db->prepare($comment_sql);
319319

320-
/**
321-
* @var array{
322-
* reporting_user_id: int,
323-
* deciding_user_id: int,
324-
* decision: string,
325-
* event_comment_id: int,
326-
* event_id: int
327-
* }|false $row
328-
*/
329-
$row = $stmt->fetch(PDO::FETCH_ASSOC);
330-
331-
while ($row) {
320+
while ( /** @var array|false */ $row = $stmt->fetch(PDO::FETCH_ASSOC)) {
332321
$total++;
333322
$comment_result = $comment_stmt->execute(['comment_id' => $row['event_comment_id']]);
334323

0 commit comments

Comments
 (0)