From 52ec7de89503b4ca05d7e92dcfe9777c1901054e Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 17 Jan 2025 18:26:47 +0600 Subject: [PATCH] pkp/pkp-lib#10671 Review Report plugin compatibility and test for 3.5.0 --- ReviewReportDAO.php | 16 +++++----------- ReviewReportPlugin.php | 18 ++++++++---------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/ReviewReportDAO.php b/ReviewReportDAO.php index 169e0c9..4bd812a 100644 --- a/ReviewReportDAO.php +++ b/ReviewReportDAO.php @@ -3,16 +3,12 @@ /** * @file plugins/reports/reviewReport/ReviewReportDAO.php * - * Copyright (c) 2014-2020 Simon Fraser University - * Copyright (c) 2003-2020 John Willinsky + * Copyright (c) 2014-2025 Simon Fraser University + * Copyright (c) 2003-2025 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class ReviewReportDAO * - * @ingroup plugins_reports_review - * - * @see ReviewReportPlugin - * * @brief Review report DAO */ @@ -28,12 +24,8 @@ class ReviewReportDAO extends DAO { /** * Get the review report data. - * - * @param int $contextId Context ID - * - * @return array */ - public function getReviewReport($contextId) + public function getReviewReport(int $contextId): array { $locale = Locale::getLocale(); @@ -118,6 +110,7 @@ public function getReviewReport($contextId) ORDER BY r.reviewer_id', [(int) $contextId] ); + $interests = []; foreach ($assignedReviewerIds as $row) { if (!array_key_exists($row->reviewer_id, $interests)) { @@ -128,6 +121,7 @@ public function getReviewReport($contextId) } } } + return [$commentsReturner, $reviewsReturner, $interests]; } } diff --git a/ReviewReportPlugin.php b/ReviewReportPlugin.php index 656ea59..e95de81 100644 --- a/ReviewReportPlugin.php +++ b/ReviewReportPlugin.php @@ -1,18 +1,14 @@ date_response_due, 11) === '00:00:00') { $row->date_response_due = substr($row->date_response_due, 0, 11) . '23:59:59'; } @@ -183,7 +181,7 @@ public function display($args, $request) if ($reviewAssignment->getDateCompleted() != null && ($reviewFormId = $reviewAssignment->getReviewFormId())) { $reviewId = $reviewAssignment->getId(); $reviewFormElements = $reviewFormElementDao->getByReviewFormId($reviewFormId); - while ($reviewFormElement = $reviewFormElements->next()) { + while ($reviewFormElement = $reviewFormElements->next()) { /** @var ReviewFormElement $reviewFormElement */ if (!$reviewFormElement->getIncluded()) { continue; } @@ -227,7 +225,7 @@ public function display($args, $request) fclose($fp); } - public function getOverdueDays($row) + public function getOverdueDays(stdClass $row): array { $responseDueTime = strtotime($row->date_response_due); $reviewDueTime = strtotime($row->date_due);