@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | class Manager |
| 26 | 26 | { |
| 27 | - const SOLR_DATE_FORMAT = 'Y-m-d\TH:i:s\Z'; |
|
| 27 | + const SOLR_DATE_FORMAT = 'Y-m-d\TH:i:s\Z'; |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * @var ModuleOptions |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @param string $path |
| 47 | 47 | * @return \SolrClient |
| 48 | 48 | */ |
| 49 | - public function getClient($path='/solr') |
|
| 49 | + public function getClient($path = '/solr') |
|
| 50 | 50 | { |
| 51 | 51 | $options = $this->options; |
| 52 | 52 | $options = [ |
@@ -69,15 +69,15 @@ discard block |
||
| 69 | 69 | * @param string $path |
| 70 | 70 | * @throws ServerException When failed adding document to server |
| 71 | 71 | */ |
| 72 | - public function addDocument(\SolrInputDocument $document,$path='/solr') |
|
| 72 | + public function addDocument(\SolrInputDocument $document, $path = '/solr') |
|
| 73 | 73 | { |
| 74 | 74 | $client = $this->getClient($path); |
| 75 | - try{ |
|
| 75 | + try { |
|
| 76 | 76 | $client->addDocument($document); |
| 77 | 77 | $client->commit(); |
| 78 | 78 | $client->optimize(); |
| 79 | - }catch (\Exception $e){ |
|
| 80 | - throw new ServerException('Can not add document to server!',$e->getCode(),$e); |
|
| 79 | + } catch (\Exception $e) { |
|
| 80 | + throw new ServerException('Can not add document to server!', $e->getCode(), $e); |
|
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
@@ -150,7 +150,7 @@ |
||
| 150 | 150 | ) |
| 151 | 151 | { |
| 152 | 152 | // get concatenated list of cities from the locations |
| 153 | - $locations = trim(implode(', ', array_unique(array_map(function (ArrayAccess $doc) |
|
| 153 | + $locations = trim(implode(', ', array_unique(array_map(function(ArrayAccess $doc) |
|
| 154 | 154 | { |
| 155 | 155 | return isset($doc->city) ? trim($doc->city) : ''; |
| 156 | 156 | }, $this->solrResult['locations']['docs'])))); |
@@ -48,10 +48,10 @@ |
||
| 48 | 48 | $query->addFilterQuery('isActive:1'); |
| 49 | 49 | $query->addField('*'); |
| 50 | 50 | |
| 51 | - if(isset($params['location'])){ |
|
| 51 | + if (isset($params['location'])) { |
|
| 52 | 52 | /* @var Location $location */ |
| 53 | 53 | $location = $params['location']; |
| 54 | - if(is_object($location->getCoordinates())){ |
|
| 54 | + if (is_object($location->getCoordinates())) { |
|
| 55 | 55 | $coordinate = Util::convertLocationCoordinates($location); |
| 56 | 56 | |
| 57 | 57 | $query->addFilterQuery( |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * @since 0.26 |
| 27 | 27 | * @package Solr\Paginator |
| 28 | 28 | */ |
| 29 | -abstract class PaginatorFactoryAbstract implements FactoryInterface,MutableCreationOptionsInterface |
|
| 29 | +abstract class PaginatorFactoryAbstract implements FactoryInterface, MutableCreationOptionsInterface |
|
| 30 | 30 | { |
| 31 | 31 | /** |
| 32 | 32 | * @var array |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | // cast to array to workaround the 'Notice: Illegal member variable name' for PHP <= 5.6.20 |
| 97 | - $result = (array)$this->facetResult[$definition['type']][$name]; |
|
| 97 | + $result = (array) $this->facetResult[$definition['type']][$name]; |
|
| 98 | 98 | // remove empty value |
| 99 | 99 | unset($result['']); |
| 100 | 100 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $query->$method($name); |
| 141 | 141 | |
| 142 | 142 | if (isset($this->params[$name]) && is_array($this->params[$name])) { |
| 143 | - $valueList = array_filter(array_map(function ($value) { |
|
| 143 | + $valueList = array_filter(array_map(function($value) { |
|
| 144 | 144 | return trim(SolrUtils::escapeQueryChars($value)); |
| 145 | 145 | }, array_keys($this->params[$name]))); |
| 146 | 146 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | protected function assertValidName($name) |
| 217 | 217 | { |
| 218 | - if (! isset($this->definitions[$name])) { |
|
| 218 | + if (!isset($this->definitions[$name])) { |
|
| 219 | 219 | throw new InvalidArgumentException(); |
| 220 | 220 | } |
| 221 | 221 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | { |
| 91 | 91 | return $this->resultConverter->convert( |
| 92 | 92 | $this->filter, |
| 93 | - $this->getResponse($offset,$itemCountPerPage)->getResponse() |
|
| 93 | + $this->getResponse($offset, $itemCountPerPage)->getResponse() |
|
| 94 | 94 | ); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * @return \SolrQueryResponse |
| 122 | 122 | * @throws ServerException |
| 123 | 123 | */ |
| 124 | - protected function getResponse($offset=0,$itemCountPerPage=0) |
|
| 124 | + protected function getResponse($offset = 0, $itemCountPerPage = 0) |
|
| 125 | 125 | { |
| 126 | 126 | $id = md5($offset.$itemCountPerPage); |
| 127 | 127 | if (!isset($this->responses[$id])) { |