From 80cc6bbbac41d37f47e8e978d9127af7be735678 Mon Sep 17 00:00:00 2001 From: Maccabee Levine Date: Mon, 25 Mar 2024 19:22:40 +0000 Subject: [PATCH] Replace method_exists with is_callable --- module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php | 2 +- module/VuFind/src/VuFind/Recommend/Databases.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php index 772236891fa..026fef882b0 100644 --- a/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php +++ b/module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php @@ -199,7 +199,7 @@ public function init($params, $request) public function process($results) { $query = $results->getParams()->getQuery(); - if (method_exists($query, 'getString')) { + if (is_callable([$query, 'getString'])) { $this->queryString = $query->getString(); } } diff --git a/module/VuFind/src/VuFind/Recommend/Databases.php b/module/VuFind/src/VuFind/Recommend/Databases.php index d7b43d0419d..9aaef03aa1c 100644 --- a/module/VuFind/src/VuFind/Recommend/Databases.php +++ b/module/VuFind/src/VuFind/Recommend/Databases.php @@ -273,7 +273,7 @@ public function getResults() // Add databases from search query if ($this->useQuery) { $queryObject = $this->results->getParams()->getQuery(); - $query = method_exists($queryObject, 'getString') + $query = is_callable([$queryObject, 'getString']) ? strtolower($queryObject->getString()) : ''; if (strlen($query) >= $this->useQueryMinLength) {