Skip to content

Commit

Permalink
Replace method_exists with is_callable
Browse files Browse the repository at this point in the history
  • Loading branch information
maccabeelevine committed Mar 25, 2024
1 parent cbbd674 commit 80cc6bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Recommend/ConsortialVuFind.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion module/VuFind/src/VuFind/Recommend/Databases.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 80cc6bb

Please sign in to comment.