From 163b359a37f67cc5f2694676d1afaca53023fb32 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 19 Oct 2017 14:23:23 -0400 Subject: [PATCH] Style fix: remove extra parentheses. --- module/VuFind/src/VuFind/Cart.php | 2 +- module/VuFind/src/VuFind/ChannelProvider/Facets.php | 2 +- .../VuFind/src/VuFind/Controller/AuthorController.php | 4 ++-- .../src/VuFind/Controller/CollectionController.php | 4 ++-- module/VuFind/src/VuFind/Controller/EITController.php | 4 ++-- .../src/VuFind/Controller/EITrecordController.php | 4 ++-- module/VuFind/src/VuFind/Controller/EdsController.php | 4 ++-- .../src/VuFind/Controller/EdsrecordController.php | 4 ++-- .../src/VuFind/Controller/LibGuidesController.php | 4 ++-- .../VuFind/src/VuFind/Controller/Plugin/DbUpgrade.php | 2 +- .../VuFind/src/VuFind/Controller/PrimoController.php | 4 ++-- .../src/VuFind/Controller/PrimorecordController.php | 4 ++-- .../VuFind/src/VuFind/Controller/RecordController.php | 4 ++-- .../VuFind/src/VuFind/Controller/SearchController.php | 4 ++-- .../VuFind/src/VuFind/Controller/SummonController.php | 4 ++-- .../src/VuFind/Controller/SummonrecordController.php | 4 ++-- .../src/VuFind/Controller/WorldcatController.php | 4 ++-- .../src/VuFind/Controller/WorldcatrecordController.php | 4 ++-- module/VuFind/src/VuFind/Db/Table/Gateway.php | 2 +- .../src/VuFind/Hierarchy/Driver/ConfigurationBased.php | 2 +- .../Hierarchy/TreeDataFormatter/AbstractBase.php | 2 +- module/VuFind/src/VuFind/ILS/Driver/DAIA.php | 10 +++++----- module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php | 2 +- module/VuFind/src/VuFind/ILS/Driver/PAIA.php | 10 +++++----- module/VuFind/src/VuFind/ILS/Driver/Voyager.php | 2 +- module/VuFind/src/VuFind/Log/LoggerFactory.php | 2 +- module/VuFind/src/VuFind/OAI/Server.php | 2 +- module/VuFind/src/VuFind/Recommend/RemoveFilters.php | 2 +- module/VuFind/src/VuFind/RecordDriver/SolrDefault.php | 2 +- module/VuFind/src/VuFind/RecordDriver/SolrMarc.php | 2 +- module/VuFind/src/VuFind/RecordTab/HierarchyTree.php | 2 +- module/VuFind/src/VuFind/Search/Base/Params.php | 6 +++--- module/VuFind/src/VuFind/Search/Base/Results.php | 2 +- .../VuFind/src/VuFind/Search/Params/PluginFactory.php | 2 +- .../src/VuFind/Search/Primo/PrimoPermissionHandler.php | 6 +++--- module/VuFind/src/VuFind/Search/Solr/Results.php | 2 +- module/VuFind/src/VuFind/Search/UrlQueryHelper.php | 6 +++--- module/VuFind/src/VuFind/Session/File.php | 2 +- module/VuFind/src/VuFind/View/Helper/Root/Citation.php | 6 +++--- module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php | 4 ++-- .../tests/unit-tests/src/VuFindTest/Auth/LDAPTest.php | 2 +- .../unit-tests/src/VuFindTest/Auth/MultiAuthTest.php | 2 +- .../tests/unit-tests/src/VuFindTest/Auth/SIP2Test.php | 2 +- .../src/VuFindSearch/Backend/Pazpar2/Connector.php | 2 +- .../src/VuFindSearch/Backend/Solr/QueryBuilder.php | 2 +- .../Backend/Solr/Response/Json/Spellcheck.php | 2 +- .../VuFindSearch/src/VuFindSearch/Query/QueryGroup.php | 2 +- module/VuFindSearch/src/VuFindSearch/Service.php | 2 +- .../unit-tests/src/VuFindTest/Query/QueryGroupTest.php | 2 +- 49 files changed, 81 insertions(+), 81 deletions(-) diff --git a/module/VuFind/src/VuFind/Cart.php b/module/VuFind/src/VuFind/Cart.php index 1e1fb424a29..a47f673827b 100644 --- a/module/VuFind/src/VuFind/Cart.php +++ b/module/VuFind/src/VuFind/Cart.php @@ -216,7 +216,7 @@ class Cart */ public function isFull() { - return (count($this->items) >= $this->maxSize); + return count($this->items) >= $this->maxSize; } /** diff --git a/module/VuFind/src/VuFind/ChannelProvider/Facets.php b/module/VuFind/src/VuFind/ChannelProvider/Facets.php index 8b87e0d5284..628200ef0f4 100644 --- a/module/VuFind/src/VuFind/ChannelProvider/Facets.php +++ b/module/VuFind/src/VuFind/ChannelProvider/Facets.php @@ -254,7 +254,7 @@ class Facets extends AbstractChannelProvider return $retVal; } - $newResults = clone($results); + $newResults = clone $results; $params = $newResults->getParams(); // Determine the filter for the current channel, and add it: diff --git a/module/VuFind/src/VuFind/Controller/AuthorController.php b/module/VuFind/src/VuFind/Controller/AuthorController.php index 9166c1858ff..02d337ce55a 100644 --- a/module/VuFind/src/VuFind/Controller/AuthorController.php +++ b/module/VuFind/src/VuFind/Controller/AuthorController.php @@ -109,7 +109,7 @@ class AuthorController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('config'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/CollectionController.php b/module/VuFind/src/VuFind/Controller/CollectionController.php index b9c079e9c65..c0c6e3152ca 100644 --- a/module/VuFind/src/VuFind/Controller/CollectionController.php +++ b/module/VuFind/src/VuFind/Controller/CollectionController.php @@ -94,7 +94,7 @@ class CollectionController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('config'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/EITController.php b/module/VuFind/src/VuFind/Controller/EITController.php index 1b75b7c8ddf..ce3fbedc838 100644 --- a/module/VuFind/src/VuFind/Controller/EITController.php +++ b/module/VuFind/src/VuFind/Controller/EITController.php @@ -60,8 +60,8 @@ class EITController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('EIT'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/EITrecordController.php b/module/VuFind/src/VuFind/Controller/EITrecordController.php index 383048904bd..5d64f7a2945 100644 --- a/module/VuFind/src/VuFind/Controller/EITrecordController.php +++ b/module/VuFind/src/VuFind/Controller/EITrecordController.php @@ -67,7 +67,7 @@ class EITrecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('EIT'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/EdsController.php b/module/VuFind/src/VuFind/Controller/EdsController.php index 692309c57b1..aef29a79af9 100644 --- a/module/VuFind/src/VuFind/Controller/EdsController.php +++ b/module/VuFind/src/VuFind/Controller/EdsController.php @@ -60,8 +60,8 @@ class EdsController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('EDS'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/EdsrecordController.php b/module/VuFind/src/VuFind/Controller/EdsrecordController.php index 7f4805e7801..26dc572250b 100644 --- a/module/VuFind/src/VuFind/Controller/EdsrecordController.php +++ b/module/VuFind/src/VuFind/Controller/EdsrecordController.php @@ -83,7 +83,7 @@ class EdsrecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('EDS'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/LibGuidesController.php b/module/VuFind/src/VuFind/Controller/LibGuidesController.php index fb44480986c..2f6d3c267e1 100644 --- a/module/VuFind/src/VuFind/Controller/LibGuidesController.php +++ b/module/VuFind/src/VuFind/Controller/LibGuidesController.php @@ -69,7 +69,7 @@ class LibGuidesController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('LibGuides'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/Plugin/DbUpgrade.php b/module/VuFind/src/VuFind/Controller/Plugin/DbUpgrade.php index 911289c30ca..10af28dce03 100644 --- a/module/VuFind/src/VuFind/Controller/Plugin/DbUpgrade.php +++ b/module/VuFind/src/VuFind/Controller/Plugin/DbUpgrade.php @@ -639,7 +639,7 @@ class DbUpgrade extends AbstractPlugin $expectedDefault = (strtoupper($expectedDefault) == 'NULL') ? null : $expectedDefault; } - return ($expectedDefault === $currentDefault); + return $expectedDefault === $currentDefault; } /** diff --git a/module/VuFind/src/VuFind/Controller/PrimoController.php b/module/VuFind/src/VuFind/Controller/PrimoController.php index 41e53cc51a4..c8eed4fc73a 100644 --- a/module/VuFind/src/VuFind/Controller/PrimoController.php +++ b/module/VuFind/src/VuFind/Controller/PrimoController.php @@ -70,8 +70,8 @@ class PrimoController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('Primo'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/PrimorecordController.php b/module/VuFind/src/VuFind/Controller/PrimorecordController.php index 43552495040..3c4002de56a 100644 --- a/module/VuFind/src/VuFind/Controller/PrimorecordController.php +++ b/module/VuFind/src/VuFind/Controller/PrimorecordController.php @@ -64,7 +64,7 @@ class PrimorecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('Primo'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/RecordController.php b/module/VuFind/src/VuFind/Controller/RecordController.php index 8e1c191c8c7..e529a9c7b46 100644 --- a/module/VuFind/src/VuFind/Controller/RecordController.php +++ b/module/VuFind/src/VuFind/Controller/RecordController.php @@ -69,7 +69,7 @@ class RecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('config'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Controller/SearchController.php b/module/VuFind/src/VuFind/Controller/SearchController.php index f2107506ed5..61ed930c7f7 100644 --- a/module/VuFind/src/VuFind/Controller/SearchController.php +++ b/module/VuFind/src/VuFind/Controller/SearchController.php @@ -673,8 +673,8 @@ class SearchController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('config'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/SummonController.php b/module/VuFind/src/VuFind/Controller/SummonController.php index 9d53ebec082..00e61076df3 100644 --- a/module/VuFind/src/VuFind/Controller/SummonController.php +++ b/module/VuFind/src/VuFind/Controller/SummonController.php @@ -60,8 +60,8 @@ class SummonController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('Summon'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/SummonrecordController.php b/module/VuFind/src/VuFind/Controller/SummonrecordController.php index 13994d49590..e7a6e5f1b6f 100644 --- a/module/VuFind/src/VuFind/Controller/SummonrecordController.php +++ b/module/VuFind/src/VuFind/Controller/SummonrecordController.php @@ -64,8 +64,8 @@ class SummonrecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('Summon'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/WorldcatController.php b/module/VuFind/src/VuFind/Controller/WorldcatController.php index 34eed26477b..65b20b16678 100644 --- a/module/VuFind/src/VuFind/Controller/WorldcatController.php +++ b/module/VuFind/src/VuFind/Controller/WorldcatController.php @@ -59,8 +59,8 @@ class WorldcatController extends AbstractSearch protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('WorldCat'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } /** diff --git a/module/VuFind/src/VuFind/Controller/WorldcatrecordController.php b/module/VuFind/src/VuFind/Controller/WorldcatrecordController.php index 1b18cbb6add..ee4b418537d 100644 --- a/module/VuFind/src/VuFind/Controller/WorldcatrecordController.php +++ b/module/VuFind/src/VuFind/Controller/WorldcatrecordController.php @@ -62,7 +62,7 @@ class WorldcatrecordController extends AbstractRecord protected function resultScrollerActive() { $config = $this->serviceLocator->get('VuFind\Config')->get('WorldCat'); - return (isset($config->Record->next_prev_navigation) - && $config->Record->next_prev_navigation); + return isset($config->Record->next_prev_navigation) + && $config->Record->next_prev_navigation; } } diff --git a/module/VuFind/src/VuFind/Db/Table/Gateway.php b/module/VuFind/src/VuFind/Db/Table/Gateway.php index bd85b822c72..5b54f38f481 100644 --- a/module/VuFind/src/VuFind/Db/Table/Gateway.php +++ b/module/VuFind/src/VuFind/Db/Table/Gateway.php @@ -108,7 +108,7 @@ class Gateway extends AbstractTableGateway */ public function createRow() { - $obj = clone($this->getResultSetPrototype()->getArrayObjectPrototype()); + $obj = clone $this->getResultSetPrototype()->getArrayObjectPrototype(); // If this is a PostgreSQL connection, we may need to initialize the ID // from a sequence: diff --git a/module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php b/module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php index e0b5e67ecd7..9aec7d2d15b 100644 --- a/module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php +++ b/module/VuFind/src/VuFind/Hierarchy/Driver/ConfigurationBased.php @@ -56,7 +56,7 @@ class ConfigurationBased extends AbstractBase { $treeConfigDriver = isset($this->config->HierarchyTree->show) ? $this->config->HierarchyTree->show : false; - return ($this->enabled && $treeConfigDriver); + return $this->enabled && $treeConfigDriver; } /** diff --git a/module/VuFind/src/VuFind/Hierarchy/TreeDataFormatter/AbstractBase.php b/module/VuFind/src/VuFind/Hierarchy/TreeDataFormatter/AbstractBase.php index dc6e86c1e61..39a288f105b 100644 --- a/module/VuFind/src/VuFind/Hierarchy/TreeDataFormatter/AbstractBase.php +++ b/module/VuFind/src/VuFind/Hierarchy/TreeDataFormatter/AbstractBase.php @@ -169,7 +169,7 @@ abstract class AbstractBase // Check config setting for what constitutes a collection switch ($this->collectionType) { case 'All': - return (isset($fields->is_hierarchy_id)); + return isset($fields->is_hierarchy_id); case 'Top': return isset($fields->is_hierarchy_id) && in_array($fields->is_hierarchy_id, $fields->hierarchy_top_id); diff --git a/module/VuFind/src/VuFind/ILS/Driver/DAIA.php b/module/VuFind/src/VuFind/ILS/Driver/DAIA.php index bc3f4119684..d23e75365f2 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/DAIA.php +++ b/module/VuFind/src/VuFind/ILS/Driver/DAIA.php @@ -506,7 +506,7 @@ class DAIA extends AbstractBase implements } } - return ($result->getBody()); + return $result->getBody(); } /** @@ -1007,9 +1007,9 @@ class DAIA extends AbstractBase implements // Check if we have at least one service unavailable and a href field is set // (either as flag or as actual value for the next action). - return ($href && count( + return $href && count( array_diff($services['unavailable'], $services['available']) - )); + ); } /** @@ -1051,9 +1051,9 @@ class DAIA extends AbstractBase implements // Check if we have at least one service unavailable and a href field is set // (either as flag or as actual value for the next action). - return ($href && count( + return $href && count( array_diff($services['available'], $services['unavailable']) - )); + ); } /** diff --git a/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php b/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php index d4c80322d9e..2a6c5705629 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php +++ b/module/VuFind/src/VuFind/ILS/Driver/MultiBackend.php @@ -1423,7 +1423,7 @@ class MultiBackend extends AbstractBase implements \Zend\Log\LoggerAwareInterfac $this->error("No configuration found for source '$source'"); return null; } - $driverInst = clone($this->driverManager->get($driver)); + $driverInst = clone $this->driverManager->get($driver); $driverInst->setConfig($config); $driverInst->init(); return $driverInst; diff --git a/module/VuFind/src/VuFind/ILS/Driver/PAIA.php b/module/VuFind/src/VuFind/ILS/Driver/PAIA.php index 69ae5d34564..9091ae0214b 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/PAIA.php +++ b/module/VuFind/src/VuFind/ILS/Driver/PAIA.php @@ -370,7 +370,7 @@ class PAIA extends DAIA */ public function getCancelHoldDetails($checkOutDetails) { - return($checkOutDetails['cancel_details']); + return $checkOutDetails['cancel_details']; } /** @@ -585,7 +585,7 @@ class PAIA extends DAIA $paiaCurrencyPattern = "/^([0-9]+\.[0-9][0-9]) ([A-Z][A-Z][A-Z])$/"; if (preg_match($paiaCurrencyPattern, $fee, $feeMatches)) { // VuFind expects fees in PENNIES - return ($feeMatches[1] * 100); + return $feeMatches[1] * 100; } return $fee; }; @@ -804,7 +804,7 @@ class PAIA extends DAIA */ public function getRenewDetails($checkOutDetails) { - return($checkOutDetails['renew_details']); + return $checkOutDetails['renew_details']; } /** @@ -1500,7 +1500,7 @@ class PAIA extends DAIA ); } // return any result as error-handling is done elsewhere - return ($result->getBody()); + return $result->getBody(); } /** @@ -1536,7 +1536,7 @@ class PAIA extends DAIA ); } // return any result as error-handling is done elsewhere - return ($result->getBody()); + return $result->getBody(); } /** diff --git a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php index 1b918c8870a..9f98530629f 100644 --- a/module/VuFind/src/VuFind/ILS/Driver/Voyager.php +++ b/module/VuFind/src/VuFind/ILS/Driver/Voyager.php @@ -2037,7 +2037,7 @@ EOT; } } } - return (empty($patron) ? null : $patron); + return empty($patron) ? null : $patron; } catch (PDOException $e) { throw new ILSException($e->getMessage()); } diff --git a/module/VuFind/src/VuFind/Log/LoggerFactory.php b/module/VuFind/src/VuFind/Log/LoggerFactory.php index 7e4155f2c88..7a2cfd41f0e 100644 --- a/module/VuFind/src/VuFind/Log/LoggerFactory.php +++ b/module/VuFind/src/VuFind/Log/LoggerFactory.php @@ -297,7 +297,7 @@ class LoggerFactory implements \Zend\ServiceManager\FactoryInterface // Clone the submitted writer since we'll need a separate instance of the // writer for each selected priority level. - $newWriter = clone($writer); + $newWriter = clone $writer; // verbosity if ($verbosity) { diff --git a/module/VuFind/src/VuFind/OAI/Server.php b/module/VuFind/src/VuFind/OAI/Server.php index 722eb0ed8c9..fca9d315b8f 100644 --- a/module/VuFind/src/VuFind/OAI/Server.php +++ b/module/VuFind/src/VuFind/OAI/Server.php @@ -403,7 +403,7 @@ class Server */ protected function hasParam($param) { - return (isset($this->params[$param]) && !empty($this->params[$param])); + return isset($this->params[$param]) && !empty($this->params[$param]); } /** diff --git a/module/VuFind/src/VuFind/Recommend/RemoveFilters.php b/module/VuFind/src/VuFind/Recommend/RemoveFilters.php index 8f921e9badf..e9bf3babee7 100644 --- a/module/VuFind/src/VuFind/Recommend/RemoveFilters.php +++ b/module/VuFind/src/VuFind/Recommend/RemoveFilters.php @@ -112,7 +112,7 @@ class RemoveFilters implements RecommendInterface */ public function hasFilters() { - return ($this->activeFacetsCount > 0); + return $this->activeFacetsCount > 0; } /** diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php index ee7b0724e48..057ca813e11 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php @@ -1601,7 +1601,7 @@ class SolrDefault extends AbstractBase // Check config setting for what constitutes a collection switch ($hierarchyDriver->getCollectionLinkType()) { case 'All': - return (isset($this->fields['is_hierarchy_id'])); + return isset($this->fields['is_hierarchy_id']); case 'Top': return isset($this->fields['is_hierarchy_title']) && isset($this->fields['is_hierarchy_id']) diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrMarc.php b/module/VuFind/src/VuFind/RecordDriver/SolrMarc.php index 693af73e45e..2074509f138 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrMarc.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrMarc.php @@ -270,7 +270,7 @@ class SolrMarc extends SolrDefault */ public function getFilteredXML() { - $record = clone($this->getMarcRecord()); + $record = clone $this->getMarcRecord(); // The default implementation does not filter out any fields // $record->deleteFields('9', true); return $record->toXML(); diff --git a/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php b/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php index 4b6d3e025e1..81fb86dc14f 100644 --- a/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php +++ b/module/VuFind/src/VuFind/RecordTab/HierarchyTree.php @@ -191,7 +191,7 @@ class HierarchyTree extends AbstractBase public function searchActive() { $config = $this->getConfig(); - return (!isset($config->Hierarchy->search) || $config->Hierarchy->search); + return !isset($config->Hierarchy->search) || $config->Hierarchy->search; } /** diff --git a/module/VuFind/src/VuFind/Search/Base/Params.php b/module/VuFind/src/VuFind/Search/Base/Params.php index 71c3f9dc4f4..23f0dc88b83 100644 --- a/module/VuFind/src/VuFind/Search/Base/Params.php +++ b/module/VuFind/src/VuFind/Search/Base/Params.php @@ -228,10 +228,10 @@ class Params public function __clone() { if (is_object($this->options)) { - $this->options = clone($this->options); + $this->options = clone $this->options; } if (is_object($this->query)) { - $this->query = clone($this->query); + $this->query = clone $this->query; } } @@ -1501,7 +1501,7 @@ class Params public function getDisplayQueryWithReplacedTerm($oldTerm, $newTerm) { // Stash our old data for a minute - $oldTerms = clone($this->query); + $oldTerms = clone $this->query; // Replace the search term $this->query->replaceTerm($oldTerm, $newTerm); // Get the new query string diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php index c5cd7ee2b69..13c3abb9764 100644 --- a/module/VuFind/src/VuFind/Search/Base/Results.php +++ b/module/VuFind/src/VuFind/Search/Base/Results.php @@ -168,7 +168,7 @@ abstract class Results public function __clone() { if (is_object($this->params)) { - $this->params = clone($this->params); + $this->params = clone $this->params; } $this->helpers = []; } diff --git a/module/VuFind/src/VuFind/Search/Params/PluginFactory.php b/module/VuFind/src/VuFind/Search/Params/PluginFactory.php index 1d2f4a92552..7df0608b777 100644 --- a/module/VuFind/src/VuFind/Search/Params/PluginFactory.php +++ b/module/VuFind/src/VuFind/Search/Params/PluginFactory.php @@ -68,6 +68,6 @@ class PluginFactory extends \VuFind\ServiceManager\AbstractPluginFactory $class = $this->getClassName($name, $requestedName); $configLoader = $serviceLocator->getServiceLocator()->get('VuFind\Config'); // Clone the options instance in case caller modifies it: - return new $class(clone($options), $configLoader, ...$extraParams); + return new $class(clone $options, $configLoader, ...$extraParams); } } diff --git a/module/VuFind/src/VuFind/Search/Primo/PrimoPermissionHandler.php b/module/VuFind/src/VuFind/Search/Primo/PrimoPermissionHandler.php index d0f43ec69ce..1d5d35b1426 100644 --- a/module/VuFind/src/VuFind/Search/Primo/PrimoPermissionHandler.php +++ b/module/VuFind/src/VuFind/Search/Primo/PrimoPermissionHandler.php @@ -98,7 +98,7 @@ class PrimoPermissionHandler */ public function instCodeExists($code) { - return (in_array($code, $this->getInstCodes()) === true); + return in_array($code, $this->getInstCodes()) === true; } /** @@ -123,7 +123,7 @@ class PrimoPermissionHandler public function hasPermission() { $code = $this->getInstCode(); - return (false !== $code && $this->checkPermission($code) === true); + return false !== $code && $this->checkPermission($code) === true; } /** @@ -308,6 +308,6 @@ class PrimoPermissionHandler $authService = $this->getAuthorizationService(); // if no authorization service is available, the user can't get permission - return ($authService && $authService->isGranted($onCampusRule)); + return $authService && $authService->isGranted($onCampusRule); } } diff --git a/module/VuFind/src/VuFind/Search/Solr/Results.php b/module/VuFind/src/VuFind/Search/Solr/Results.php index a4e0961dfb3..7b3a983f7f3 100644 --- a/module/VuFind/src/VuFind/Search/Solr/Results.php +++ b/module/VuFind/src/VuFind/Search/Solr/Results.php @@ -303,7 +303,7 @@ class Results extends \VuFind\Search\Base\Results public function getPartialFieldFacets($facetfields, $removeFilter = true, $limit = -1, $facetSort = null, $page = null, $ored = false ) { - $clone = clone($this); + $clone = clone $this; $params = $clone->getParams(); // Manipulate facet settings temporarily: diff --git a/module/VuFind/src/VuFind/Search/UrlQueryHelper.php b/module/VuFind/src/VuFind/Search/UrlQueryHelper.php index 57fa30a3e41..eed2af05fa5 100644 --- a/module/VuFind/src/VuFind/Search/UrlQueryHelper.php +++ b/module/VuFind/src/VuFind/Search/UrlQueryHelper.php @@ -244,7 +244,7 @@ class UrlQueryHelper */ public function replaceTerm($from, $to) { - $query = clone($this->queryObject); + $query = clone $this->queryObject; $query->replaceTerm($from, $to); return new static($this->urlParams, $query, $this->config); } @@ -453,7 +453,7 @@ class UrlQueryHelper */ public function setHandler($handler) { - $query = clone($this->queryObject); + $query = clone $this->queryObject; // We can only set the handler on basic queries: if ($query instanceof Query) { $query->setHandler($handler); @@ -552,7 +552,7 @@ class UrlQueryHelper */ protected function filtered($field, $value, $filter) { - return (isset($filter[$field]) && preg_match($filter[$field], $value)); + return isset($filter[$field]) && preg_match($filter[$field], $value); } /** diff --git a/module/VuFind/src/VuFind/Session/File.php b/module/VuFind/src/VuFind/Session/File.php index b9393657642..17d5cefc0db 100644 --- a/module/VuFind/src/VuFind/Session/File.php +++ b/module/VuFind/src/VuFind/Session/File.php @@ -116,7 +116,7 @@ class File extends AbstractBase // Perform file-specific cleanup: $sess_file = $this->getPath() . '/sess_' . $sess_id; if (file_exists($sess_file)) { - return(unlink($sess_file)); + return unlink($sess_file); } return true; } diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Citation.php b/module/VuFind/src/VuFind/View/Helper/Root/Citation.php index 2a23e868d8a..e4ff42c650d 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Citation.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Citation.php @@ -508,7 +508,7 @@ class Citation extends \Zend\View\Helper\AbstractHelper protected function isPunctuated($string) { $punctuation = ['.', '?', '!']; - return (in_array(substr($string, -1), $punctuation)); + return in_array(substr($string, -1), $punctuation); } /** @@ -638,7 +638,7 @@ class Citation extends \Zend\View\Helper\AbstractHelper $i++; } } - return (empty($authorStr) ? false : $authorStr); + return empty($authorStr) ? false : $authorStr; } /** @@ -720,7 +720,7 @@ class Citation extends \Zend\View\Helper\AbstractHelper } } } - return (empty($authorStr) ? false : $this->stripPunctuation($authorStr)); + return empty($authorStr) ? false : $this->stripPunctuation($authorStr); } /** diff --git a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php index b53b25af492..359d3ec9f60 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/OpenUrl.php @@ -306,7 +306,7 @@ class OpenUrl extends \Zend\View\Helper\AbstractHelper // If we got this far, use the defaults -- true for results, false for // everywhere else. - return ($this->area == 'results'); + return $this->area == 'results'; } /** @@ -426,7 +426,7 @@ class OpenUrl extends \Zend\View\Helper\AbstractHelper } // Did all the rules match? - return ($ruleMatchCounter == count($rules)); + return $ruleMatchCounter == count($rules); } /** diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LDAPTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LDAPTest.php index c9b71aa78a2..3d8d1841dbb 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LDAPTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/LDAPTest.php @@ -52,7 +52,7 @@ class LDAPTest extends \VuFindTest\Unit\DbTestCase if (null === $config) { $config = $this->getAuthConfig(); } - $obj = clone($this->getAuthManager()->get('LDAP')); + $obj = clone $this->getAuthManager()->get('LDAP'); $obj->setConfig($config); return $obj; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php index 70a176bb42b..1c29828ea13 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/MultiAuthTest.php @@ -59,7 +59,7 @@ class MultiAuthTest extends \VuFindTest\Unit\DbTestCase ] ) ); - $obj = clone($this->getAuthManager()->get('MultiAuth')); + $obj = clone $this->getAuthManager()->get('MultiAuth'); $obj->setConfig($config); return $obj; } diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/SIP2Test.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/SIP2Test.php index de2eeb158c8..1333b4f45b6 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/SIP2Test.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Auth/SIP2Test.php @@ -52,7 +52,7 @@ class SIP2Test extends \VuFindTest\Unit\DbTestCase if (null === $config) { $config = $this->getAuthConfig(); } - $obj = clone($this->getAuthManager()->get('SIP2')); + $obj = clone $this->getAuthManager()->get('SIP2'); $obj->setConfig($config); return $obj; } diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Pazpar2/Connector.php b/module/VuFindSearch/src/VuFindSearch/Backend/Pazpar2/Connector.php index ac7aa37d658..7b2ff2a6640 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Pazpar2/Connector.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Pazpar2/Connector.php @@ -122,7 +122,7 @@ class Connector implements \Zend\Log\LoggerAwareInterface } // Don't change input when manipulating parameters: - $params = (null === $data) ? new ParamBag() : clone($data); + $params = (null === $data) ? new ParamBag() : clone $data; // Add session and command: if ($this->session) { diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/QueryBuilder.php b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/QueryBuilder.php index af8fc03dacc..743564b7a34 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/QueryBuilder.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/QueryBuilder.php @@ -133,7 +133,7 @@ class QueryBuilder implements QueryBuilderInterface $finalQuery = $this->reduceQueryGroup($query); } else { // Clone the query to avoid modifying the original user-visible query - $finalQuery = clone($query); + $finalQuery = clone $query; $finalQuery->setString($this->getNormalizedQueryString($query)); } $string = $finalQuery->getString() ?: '*:*'; diff --git a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Response/Json/Spellcheck.php b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Response/Json/Spellcheck.php index 93b465c8446..7b2493847b3 100644 --- a/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Response/Json/Spellcheck.php +++ b/module/VuFindSearch/src/VuFindSearch/Backend/Solr/Response/Json/Spellcheck.php @@ -200,6 +200,6 @@ class Spellcheck implements IteratorAggregate, Countable */ public function compareTermLength($a, $b) { - return (strlen($b) - strlen($a)); + return strlen($b) - strlen($a); } } diff --git a/module/VuFindSearch/src/VuFindSearch/Query/QueryGroup.php b/module/VuFindSearch/src/VuFindSearch/Query/QueryGroup.php index 35eb6645cae..b3ffc251269 100644 --- a/module/VuFindSearch/src/VuFindSearch/Query/QueryGroup.php +++ b/module/VuFindSearch/src/VuFindSearch/Query/QueryGroup.php @@ -106,7 +106,7 @@ class QueryGroup extends AbstractQuery { $new = []; foreach ($this->queries as $q) { - $new[] = clone($q); + $new[] = clone $q; } $this->queries = $new; } diff --git a/module/VuFindSearch/src/VuFindSearch/Service.php b/module/VuFindSearch/src/VuFindSearch/Service.php index 2b01dae9f5c..2cb3d846de3 100644 --- a/module/VuFindSearch/src/VuFindSearch/Service.php +++ b/module/VuFindSearch/src/VuFindSearch/Service.php @@ -356,7 +356,7 @@ class Service if (!isset($this->backends[$backend])) { $response = $this->getEventManager()->triggerUntil( function ($o) { - return ($o instanceof BackendInterface); + return $o instanceof BackendInterface; }, self::EVENT_RESOLVE, $this, diff --git a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Query/QueryGroupTest.php b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Query/QueryGroupTest.php index 8b91ac0200d..de0dd364daa 100644 --- a/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Query/QueryGroupTest.php +++ b/module/VuFindSearch/tests/unit-tests/src/VuFindTest/Query/QueryGroupTest.php @@ -95,7 +95,7 @@ class QueryGroupTest extends PHPUnit_Framework_TestCase public function testClone() { $q = $this->getSampleQueryGroup(); - $qClone = clone($q); + $qClone = clone $q; $q->replaceTerm('query', 'question'); $qClone->setOperator('AND'); $this->assertEquals('test question multi word question', $q->getAllTerms()); -- GitLab