diff --git a/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php b/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php index 00d1a48b9c99e1f014716c80b54639a3fdc96e54..3899c90e7787f5aae3da0b1098e280d1654411e7 100644 --- a/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php +++ b/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php @@ -62,7 +62,8 @@ class Solr extends AbstractBase * @param SearchService $search Search service * @param string $cacheDir Directory to hold cache results (optional) */ - public function __construct(SearchService $search, $cacheDir = null) { + public function __construct(SearchService $search, $cacheDir = null) + { $this->searchService = $search; if (null !== $cacheDir) { $this->cacheDir = rtrim($cacheDir, '/'); diff --git a/module/VuFind/src/VuFind/Recommend/SearchObject.php b/module/VuFind/src/VuFind/Recommend/SearchObject.php index 1ec41dd79f7afb11234975b8422935fa0a548295..fb829cdb6e1aa7619baa0b9a63f71a78b4f4009a 100644 --- a/module/VuFind/src/VuFind/Recommend/SearchObject.php +++ b/module/VuFind/src/VuFind/Recommend/SearchObject.php @@ -73,7 +73,8 @@ abstract class SearchObject implements RecommendInterface * * @param \VuFind\Search\Results\PluginManager $results Results plugin manager */ - public function __construct(\VuFind\Search\Results\PluginManager $results) { + public function __construct(\VuFind\Search\Results\PluginManager $results) + { $this->resultsManager = $results; } diff --git a/module/VuFind/src/VuFind/Related/Editions.php b/module/VuFind/src/VuFind/Related/Editions.php index c9ff258466db5770073ea62e859962ecbccf6fe8..c6f5c6934f5d5fdfe5634573225f680bca9357a1 100644 --- a/module/VuFind/src/VuFind/Related/Editions.php +++ b/module/VuFind/src/VuFind/Related/Editions.php @@ -63,10 +63,11 @@ class Editions implements RelatedInterface * Constructor * * @param \VuFind\Search\Results\PluginManager $results Results plugin manager + * @param \VuFind\Connection\WorldCatUtils $wcUtils WorldCat utils object */ public function __construct(\VuFind\Search\Results\PluginManager $results, - \VuFind\Connection\WorldCatUtils $wcUtils) - { + \VuFind\Connection\WorldCatUtils $wcUtils + ) { $this->resultsManager = $results; $this->wcUtils = $wcUtils; } diff --git a/module/VuFind/src/VuFind/Search/Base/Results.php b/module/VuFind/src/VuFind/Search/Base/Results.php index a901554d611d3f4102e93c4ac8c051d809e102fb..9f40d387101f7207709d295515b1d85027f255a5 100644 --- a/module/VuFind/src/VuFind/Search/Base/Results.php +++ b/module/VuFind/src/VuFind/Search/Base/Results.php @@ -596,10 +596,11 @@ abstract class Results implements ServiceLocatorAwareInterface * * @return SearchService * - * @todo May better error handling, throw a custom exception if search service not present + * @todo May better error handling, throw a custom exception if search service + * not present * @tag NEW SEARCH */ - protected function getSearchService () + protected function getSearchService() { if (!$this->searchService) { $this->searchService = $this->getServiceLocator()->get('VuFind\Search'); diff --git a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php index 6250e924e4e837b6e569089022d225369cb7617d..53dde6202c9b6de4d4728d93979534a6d2819996 100644 --- a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php @@ -97,7 +97,8 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * Constructor */ public function __construct() - {} + { + } /** * Create the backend. @@ -106,7 +107,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * * @return BackendInterface */ - public function createService (ServiceLocatorInterface $serviceLocator) + public function createService(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; $this->config = $this->serviceLocator->get('VuFind\Config'); @@ -122,11 +123,11 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface /** * Create the SOLR backend. * - * @param Connector $connector Connector + * @param Connector $connector Connector * * @return Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $config = $this->config->get('config'); @@ -156,7 +157,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * * @return void */ - protected function createListeners (Backend $backend) + protected function createListeners(Backend $backend) { $events = $this->serviceLocator->get('SharedEventManager'); @@ -206,7 +207,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * * @return Connector */ - protected function createConnector () + protected function createConnector() { $config = $this->config->get('config'); $search = $this->config->get($this->searchConfig); @@ -246,7 +247,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * * @return QueryBuilder */ - protected function createQueryBuilder () + protected function createQueryBuilder() { $specs = $this->loadSpecs(); $builder = new QueryBuilder($specs); @@ -268,7 +269,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface * * @return array */ - protected function loadSpecs () + protected function loadSpecs() { $specs = $this->serviceLocator->get('VuFind\SearchSpecsReader')->get($this->searchYaml); return $specs; diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrAuthBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrAuthBackendFactory.php index af6468aa64cf17d78602b1149897d2969dc00aa6..892520d755bb9709b61cf764ab3d90e8e40d38ec 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrAuthBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrAuthBackendFactory.php @@ -59,7 +59,7 @@ class SolrAuthBackendFactory extends AbstractSolrBackendFactory * * @return \VuFindSearch\Backend\Solr\Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $backend = parent::createBackend($connector); $manager = $this->serviceLocator->get('VuFind\RecordDriverPluginManager'); diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrDefaultBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrDefaultBackendFactory.php index 482655d8166ded54ae70eae2aad7406ae3ddfa6f..2a89ea5f5b3d85ac77933de5f819681409e2f4c1 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrDefaultBackendFactory.php @@ -72,11 +72,11 @@ class SolrDefaultBackendFactory extends AbstractSolrBackendFactory /** * Create the SOLR backend. * - * @param Connector $connector Connector + * @param Connector $connector Connector * * @return Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $backend = parent::createBackend($connector); $manager = $this->serviceLocator->get('VuFind\RecordDriverPluginManager'); diff --git a/module/VuFind/src/VuFind/Search/Factory/SolrReservesBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SolrReservesBackendFactory.php index dc632f56f7883ce0c3f8386b73b5ffe0e8e01251..9013154dfe82e79c8271f411ce425bd6841952a6 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SolrReservesBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SolrReservesBackendFactory.php @@ -59,7 +59,7 @@ class SolrReservesBackendFactory extends AbstractSolrBackendFactory * * @return \VuFindSearch\Backend\Solr\Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $backend = parent::createBackend($connector); $manager = $this->serviceLocator->get('VuFind\RecordDriverPluginManager'); diff --git a/module/VuFind/src/VuFind/Search/Factory/SummonBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/SummonBackendFactory.php index a062ab9ef74ac967ad7e91c3d3f643b55311e009..42e4a7ae512ba6cc628072b6f06ed773267a5e41 100644 --- a/module/VuFind/src/VuFind/Search/Factory/SummonBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/SummonBackendFactory.php @@ -84,7 +84,7 @@ class SummonBackendFactory implements FactoryInterface * * @return BackendInterface */ - public function createService (ServiceLocatorInterface $serviceLocator) + public function createService(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; $configReader = $this->serviceLocator->get('VuFind\Config'); @@ -101,11 +101,11 @@ class SummonBackendFactory implements FactoryInterface /** * Create the Summon backend. * - * @param Connector $connector Connector + * @param Connector $connector Connector * * @return Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $backend = new Backend($connector, $this->createRecordCollectionFactory()); $backend->setLogger($this->logger); @@ -118,7 +118,7 @@ class SummonBackendFactory implements FactoryInterface * * @return Connector */ - protected function createConnector () + protected function createConnector() { // Load credentials: $id = isset($this->config->Summon->apiId) @@ -142,7 +142,7 @@ class SummonBackendFactory implements FactoryInterface * * @return QueryBuilder */ - protected function createQueryBuilder () + protected function createQueryBuilder() { $builder = new QueryBuilder(); $builder->caseSensitiveBooleans @@ -156,7 +156,7 @@ class SummonBackendFactory implements FactoryInterface * * @return RecordCollectionFactory */ - protected function createRecordCollectionFactory () + protected function createRecordCollectionFactory() { $manager = $this->serviceLocator->get('VuFind\RecordDriverPluginManager'); $stripSnippets = !isset($this->summonConfig->General->snippets) diff --git a/module/VuFind/src/VuFind/Search/Factory/WorldCatBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/WorldCatBackendFactory.php index bdba88b11c03435d961d4c2a45fef3829660a56d..dae074f226420c0714eae8c74b800360ef290e24 100644 --- a/module/VuFind/src/VuFind/Search/Factory/WorldCatBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/WorldCatBackendFactory.php @@ -77,7 +77,7 @@ class WorldCatBackendFactory implements FactoryInterface * * @return BackendInterface */ - public function createService (ServiceLocatorInterface $serviceLocator) + public function createService(ServiceLocatorInterface $serviceLocator) { $this->serviceLocator = $serviceLocator; $this->config = $this->serviceLocator->get('VuFind\Config')->get('config'); @@ -92,11 +92,11 @@ class WorldCatBackendFactory implements FactoryInterface /** * Create the WorldCat backend. * - * @param Connector $connector Connector + * @param Connector $connector Connector * * @return Backend */ - protected function createBackend (Connector $connector) + protected function createBackend(Connector $connector) { $backend = new Backend($connector, $this->createRecordCollectionFactory()); $backend->setLogger($this->logger); @@ -109,7 +109,7 @@ class WorldCatBackendFactory implements FactoryInterface * * @return Connector */ - protected function createConnector () + protected function createConnector() { $wsKey = isset($this->config->WorldCat->apiKey) ? $this->config->WorldCat->apiKey : null; @@ -128,7 +128,7 @@ class WorldCatBackendFactory implements FactoryInterface * * @return QueryBuilder */ - protected function createQueryBuilder () + protected function createQueryBuilder() { $exclude = isset($this->config->WorldCat->OCLCCode) ? $this->config->WorldCat->OCLCCode : null; @@ -140,7 +140,7 @@ class WorldCatBackendFactory implements FactoryInterface * * @return RecordCollectionFactory */ - protected function createRecordCollectionFactory () + protected function createRecordCollectionFactory() { $manager = $this->serviceLocator->get('VuFind\RecordDriverPluginManager'); $callback = function ($data) use ($manager) { diff --git a/module/VuFind/src/VuFind/Search/Summon/Results.php b/module/VuFind/src/VuFind/Search/Summon/Results.php index 1b675cab028e0960b6095b49cffd9472cf2bcdfa..07e6f9ba05fe17cebdb66d0104eea4a83145ebb8 100644 --- a/module/VuFind/src/VuFind/Search/Summon/Results.php +++ b/module/VuFind/src/VuFind/Search/Summon/Results.php @@ -213,16 +213,20 @@ class Results extends BaseResults // Special case -- "holdings only" is a separate parameter from // other facets. if ($filt['field'] == 'holdingsOnly') { - $params->set('holdings', strtolower(trim($safeValue)) == 'true'); + $params->set( + 'holdings', strtolower(trim($safeValue)) == 'true' + ); } else if ($filt['field'] == 'excludeNewspapers') { // Special case -- support a checkbox for excluding // newspapers: - $params->add('filters', "ContentType,Newspaper Article,true"); + $params + ->add('filters', "ContentType,Newspaper Article,true"); } else if ($range = SolrUtils::parseRange($filt['value'])) { // Special case -- range query (translate [x TO y] syntax): $from = SummonQuery::escapeParam($range['from']); $to = SummonQuery::escapeParam($range['to']); - $params->add('rangeFilters', "{$filt['field']},{$from}:{$to}"); + $params + ->add('rangeFilters', "{$filt['field']},{$from}:{$to}"); } else { // Standard case: $params->add('filters', "{$filt['field']},{$safeValue}"); diff --git a/module/VuFind/src/VuFind/Search/WorldCat/Results.php b/module/VuFind/src/VuFind/Search/WorldCat/Results.php index 8f180a0fb2178c94a15af58f62527c5b54887742..29ad87229b2347824d3e430851bb3c51a1135c83 100644 --- a/module/VuFind/src/VuFind/Search/WorldCat/Results.php +++ b/module/VuFind/src/VuFind/Search/WorldCat/Results.php @@ -53,7 +53,8 @@ class Results extends \VuFind\Search\Base\Results $limit = $this->getParams()->getLimit(); $offset = $this->getStartRecord() - 1; $params = $this->createBackendParameters($query, $this->getParams()); - $collection = $this->getSearchService()->search('WorldCat', $query, $offset, $limit, $params); + $collection = $this->getSearchService() + ->search('WorldCat', $query, $offset, $limit, $params); $this->resultTotal = $collection->getTotal(); $this->results = $collection->getRecords(); @@ -97,12 +98,13 @@ class Results extends \VuFind\Search\Base\Results /** * Create search backend parameters for advanced features. * - * @param Params $params Search parameters + * @param AbstractQuery $query Query being processed + * @param Params $params Search parameters * * @return ParamBag * @tag NEW SEARCH */ - protected function createBackendParameters (AbstractQuery $query, Params $params) + protected function createBackendParameters(AbstractQuery $query, Params $params) { $backendParams = new ParamBag(); diff --git a/module/VuFind/src/VuFind/Sitemap.php b/module/VuFind/src/VuFind/Sitemap.php index 5d49dda20e4f800af23cd146a628817e44976f7f..bef5a8d8792bbcdf821a98be29d4a54b71e376d6 100644 --- a/module/VuFind/src/VuFind/Sitemap.php +++ b/module/VuFind/src/VuFind/Sitemap.php @@ -139,7 +139,7 @@ class Sitemap // Get $currentPageInfo = $this->backend->terms('id', $last_term, $this->countPerPage) - ->getFieldTerms('id'); + ->getFieldTerms('id'); if (null === $currentPageInfo || count($currentPageInfo) < 1) { break; } else { diff --git a/module/VuFind/src/VuFind/Solr/Writer.php b/module/VuFind/src/VuFind/Solr/Writer.php index fd4a7989ac0497fcc5ef41638ff512f9faec6e0c..09ab24087b5ef322af173a2e1c471b7a8b85ea90 100644 --- a/module/VuFind/src/VuFind/Solr/Writer.php +++ b/module/VuFind/src/VuFind/Solr/Writer.php @@ -104,7 +104,7 @@ class Writer * Delete an array of IDs from the specified search backend * * @param string $backend Backend ID - * @param array $ids Record IDs to delete + * @param array $idList Record IDs to delete * * @return void */ @@ -153,6 +153,8 @@ class Writer /** * Get the connector for a specified backend. * + * @param string $backend Backend ID + * * @return Connector */ protected function getConnector($backend) diff --git a/module/VuFind/src/VuFindTest/Unit/TestCase.php b/module/VuFind/src/VuFindTest/Unit/TestCase.php index 8605cb42b86230077bafd00bd3c47326cf3090a7..7864c2b2c8b7cf0bb65434bbed8f3040e835f589 100644 --- a/module/VuFind/src/VuFindTest/Unit/TestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/TestCase.php @@ -143,7 +143,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase $optionsFactory = new \VuFind\Search\Options\PluginManager( new \Zend\ServiceManager\Config( array( - 'abstract_factories' => array('VuFind\Search\Options\PluginFactory'), + 'abstract_factories' => + array('VuFind\Search\Options\PluginFactory'), 'aliases' => array('VuFind' => 'Solr'), ) ) @@ -155,7 +156,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase $paramsFactory = new \VuFind\Search\Params\PluginManager( new \Zend\ServiceManager\Config( array( - 'abstract_factories' => array('VuFind\Search\Params\PluginFactory'), + 'abstract_factories' => + array('VuFind\Search\Params\PluginFactory'), 'aliases' => array('VuFind' => 'Solr'), ) ) @@ -167,7 +169,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase $resultsFactory = new \VuFind\Search\Results\PluginManager( new \Zend\ServiceManager\Config( array( - 'abstract_factories' => array('VuFind\Search\Results\PluginFactory'), + 'abstract_factories' => + array('VuFind\Search\Results\PluginFactory'), 'aliases' => array('VuFind' => 'Solr'), ) )