From 022056c4ff30b2c9ffc3950b29db2064d93e07b5 Mon Sep 17 00:00:00 2001
From: Demian Katz <demian.katz@villanova.edu>
Date: Mon, 15 Apr 2013 13:13:31 -0400
Subject: [PATCH] Style fixes.

---
 .../VuFind/Hierarchy/TreeDataSource/Solr.php    |  3 ++-
 .../src/VuFind/Recommend/SearchObject.php       |  3 ++-
 module/VuFind/src/VuFind/Related/Editions.php   |  5 +++--
 .../VuFind/src/VuFind/Search/Base/Results.php   |  5 +++--
 .../Factory/AbstractSolrBackendFactory.php      | 17 +++++++++--------
 .../Search/Factory/SolrAuthBackendFactory.php   |  2 +-
 .../Factory/SolrDefaultBackendFactory.php       |  4 ++--
 .../Factory/SolrReservesBackendFactory.php      |  2 +-
 .../Search/Factory/SummonBackendFactory.php     | 12 ++++++------
 .../Search/Factory/WorldCatBackendFactory.php   | 12 ++++++------
 .../VuFind/src/VuFind/Search/Summon/Results.php | 10 +++++++---
 .../src/VuFind/Search/WorldCat/Results.php      |  8 +++++---
 module/VuFind/src/VuFind/Sitemap.php            |  2 +-
 module/VuFind/src/VuFind/Solr/Writer.php        |  4 +++-
 module/VuFind/src/VuFindTest/Unit/TestCase.php  |  9 ++++++---
 15 files changed, 57 insertions(+), 41 deletions(-)

diff --git a/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php b/module/VuFind/src/VuFind/Hierarchy/TreeDataSource/Solr.php
index 00d1a48b9c9..3899c90e778 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 1ec41dd79f7..fb829cdb6e1 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 c9ff258466d..c6f5c6934f5 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 a901554d611..9f40d387101 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 6250e924e4e..53dde6202c9 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 af6468aa64c..892520d755b 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 482655d8166..2a89ea5f5b3 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 dc632f56f78..9013154dfe8 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 a062ab9ef74..42e4a7ae512 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 bdba88b11c0..dae074f2264 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 1b675cab028..07e6f9ba05f 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 8f180a0fb21..29ad87229b2 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 5d49dda20e4..bef5a8d8792 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 fd4a7989ac0..09ab24087b5 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 8605cb42b86..7864c2b2c8b 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'),
                     )
                 )
-- 
GitLab