From b1ec2ed6d9cd35d6c5e8669ebc8d4fdb9b320558 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 17 May 2019 09:51:20 +1200 Subject: [PATCH 1/2] Remove unused class imports, import docblock reference for Apache_Solr_Response, use strict comparison --- bin/fulltextsearch_quickstart | 0 src/Solr/Services/SolrService.php | 6 ++---- 2 files changed, 2 insertions(+), 4 deletions(-) mode change 100644 => 100755 bin/fulltextsearch_quickstart diff --git a/bin/fulltextsearch_quickstart b/bin/fulltextsearch_quickstart old mode 100644 new mode 100755 diff --git a/src/Solr/Services/SolrService.php b/src/Solr/Services/SolrService.php index 1044260..4ce595f 100644 --- a/src/Solr/Services/SolrService.php +++ b/src/Solr/Services/SolrService.php @@ -2,10 +2,8 @@ namespace SilverStripe\FullTextSearch\Solr\Services; +use Apache_Solr_Response; use SilverStripe\Core\Config\Config; -use SilverStripe\FullTextSearch\Solr\Solr; -use SilverStripe\FullTextSearch\Solr\SolrIndex; -use Silverstripe\Core\ClassInfo; /** * The API for accessing the primary Solr installation, which includes both SolrService_Core, @@ -23,7 +21,7 @@ class SolrService extends SolrService_Core { $command = strtoupper($command); $params = array_merge($params, array('action' => $command, 'wt' => 'json')); - $params[$command == 'CREATE' ? 'name' : 'core'] = $core; + $params[$command === 'CREATE' ? 'name' : 'core'] = $core; return $this->_sendRawGet($this->_constructUrl('admin/cores', $params)); } From 14b35f1935c9954041fc995165d39ca82ff604a7 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 17 May 2019 09:53:16 +1200 Subject: [PATCH 2/2] DOCS Fix doc block formatting in SolrService --- src/Solr/Services/SolrService.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/Solr/Services/SolrService.php b/src/Solr/Services/SolrService.php index 4ce595f..b717751 100644 --- a/src/Solr/Services/SolrService.php +++ b/src/Solr/Services/SolrService.php @@ -16,6 +16,11 @@ class SolrService extends SolrService_Core /** * Handle encoding the GET parameters and making the HTTP call to execute a core command + * + * @param string $command + * @param string $core + * @param array $params + * @return Apache_Solr_Response */ protected function coreCommand($command, $core, $params = array()) { @@ -28,6 +33,7 @@ class SolrService extends SolrService_Core /** * Is the passed core active? + * * @param string $core The name of the core (an encoded class name) * @return boolean True if that core exists & is active */ @@ -40,11 +46,12 @@ class SolrService extends SolrService_Core /** * Create a new core - * @param $core string - The name of the core - * @param $instancedir string - The base path of the core on the server - * @param $config string - The filename of solrconfig.xml on the server. Default is $instancedir/solrconfig.xml - * @param $schema string - The filename of schema.xml on the server. Default is $instancedir/schema.xml - * @param $datadir string - The path to store data for this core on the server. Default depends on solrconfig.xml + * + * @param string $core The name of the core + * @param string $instancedir The base path of the core on the server + * @param string $config The filename of solrconfig.xml on the server. Default is $instancedir/solrconfig.xml + * @param string $schema The filename of schema.xml on the server. Default is $instancedir/schema.xml + * @param string $datadir The path to store data for this core on the server. Default depends on solrconfig.xml * @return Apache_Solr_Response */ public function coreCreate($core, $instancedir, $config = null, $schema = null, $datadir = null) @@ -65,7 +72,8 @@ class SolrService extends SolrService_Core /** * Reload a core - * @param $core string - The name of the core + * + * @param string $core The name of the core * @return Apache_Solr_Response */ public function coreReload($core) @@ -75,7 +83,8 @@ class SolrService extends SolrService_Core /** * Create a new Solr4Service_Core instance for the passed core - * @param $core string - The name of the core + * + * @param string $core The name of the core * @return Solr4Service_Core */ public function serviceForCore($core)