Commit 5d9b6d5e authored by Bas de Nooijer's avatar Bas de Nooijer

php-cs-fixer changes

parent fc819735
......@@ -43,7 +43,6 @@ use Solarium\Core\Client\Response;
use Solarium\Core\Client\Endpoint;
use Solarium\Exception\HttpException;
/**
* Basic HTTP adapter using a stream
*/
......
......@@ -46,7 +46,6 @@ use Solarium\Core\Client\Request;
use Solarium\Core\Client\Response;
use Solarium\Core\Client\Endpoint;
use Solarium\Exception\HttpException;
use Solarium\Exception\RuntimeException;
use Solarium\Exception\OutOfBoundsException;
/**
......
......@@ -59,7 +59,6 @@ use Solarium\Core\Event\PostExecute as PostExecuteEvent;
use Solarium\Core\Event\PreExecuteRequest as PreExecuteRequestEvent;
use Solarium\Core\Event\PostExecuteRequest as PostExecuteRequestEvent;
/**
* Main interface for interaction with Solr
*
......
......@@ -334,6 +334,7 @@ class Request extends Configurable
}
$this->setOption('file', $filename);
return $this;
}
......@@ -463,9 +464,11 @@ class Request extends Configurable
* @param string $password
* @return self Provides fluent interface
*/
public function setAuthentication($username, $password) {
public function setAuthentication($username, $password)
{
$this->setOption('username', $username);
$this->setOption('password', $password);
return $this;
}
......
......@@ -40,9 +40,6 @@ namespace Solarium\Core\Plugin;
use Solarium\Core\Client\Client;
use Solarium\Core\Configurable;
use Solarium\Core\Query\Query;
use Solarium\Core\Client\Request;
use Solarium\Core\Client\Response;
use Solarium\Core\Query\Result\Result;
/**
* Base class for plugins
......
......@@ -40,9 +40,6 @@ namespace Solarium\Core\Plugin;
use Solarium\Core\ConfigurableInterface;
use Solarium\Core\Client\Client;
use Solarium\Core\Query\Query;
use Solarium\Core\Client\Request;
use Solarium\Core\Client\Response;
use Solarium\Core\Query\Result\Result;
/**
* Interface for plugins
......
......@@ -201,7 +201,7 @@ abstract class Query extends Configurable implements QueryInterface
public function getResponseWriter()
{
$responseWriter = $this->getOption('responsewriter');
if ($responseWriter === null ) {
if ($responseWriter === null) {
$responseWriter = self::WT_JSON;
}
......
......@@ -63,7 +63,7 @@ abstract class ResponseParser
$key = $data[$i];
$value = $data[$i+1];
if (array_key_exists($key, $keys)) {
if($keys[$key] == 1) {
if ($keys[$key] == 1) {
$result[$key] = array($result[$key]);
}
$result[$key][] = $value;
......
......@@ -42,7 +42,6 @@ use Solarium\Core\Plugin\Plugin;
use Solarium\QueryType\Update\Result as UpdateResult;
use Solarium\QueryType\Update\Query\Query as UpdateQuery;
use Solarium\QueryType\Select\Result\DocumentInterface;
use Solarium\QueryType\Select\Result\Document as ReadOnlyDocument;
use Solarium\Plugin\BufferedAdd\Event\Events;
use Solarium\Plugin\BufferedAdd\Event\PreFlush as PreFlushEvent;
use Solarium\Plugin\BufferedAdd\Event\PostFlush as PostFlushEvent;
......
......@@ -47,7 +47,7 @@ class Events
/**
* This event is called before a buffer flush
*
* The event listener receives the buffer (array).
* The event listener receives the buffer (array) .
*
* @var string
*/
......@@ -62,11 +62,10 @@ class Events
*/
const POST_FLUSH = 'solarium.bufferedAdd.postFlush';
/**
* This event is called before a buffer commit
*
* The event listener receives the buffer (array).
* The event listener receives the buffer (array) .
*
* @var string
*/
......
......@@ -38,7 +38,6 @@
*/
namespace Solarium\Plugin\CustomizeRequest;
use Solarium\Core\Plugin\Plugin;
use Solarium\Core\Query\Query;
use Solarium\Core\Client\Request;
use Solarium\Exception\InvalidArgumentException;
use Solarium\Exception\RuntimeException;
......
......@@ -85,5 +85,4 @@ class EndpointFailure extends Event
return $this->exception;
}
}
......@@ -128,7 +128,7 @@ class WeightedRandomChoice
$high = count($this->lookup)-1;
$low = 0;
while ( $low < $high ) {
while ($low < $high) {
$probe = (int) (($high + $low) / 2);
if ($this->lookup[$probe] < $random) {
$low = $probe + 1;
......
......@@ -38,7 +38,6 @@
*/
namespace Solarium\Plugin\ParallelExecution\Event;
use Symfony\Component\EventDispatcher\Event;
use Solarium\QueryType\Update\Result;
/**
* ExecuteStart event, see Events for details
......
......@@ -37,7 +37,6 @@
* @namespace
*/
namespace Solarium\QueryType\Analysis\ResponseParser;
use Solarium\QueryType\Analysis\Result as AnalysisResult;
use Solarium\QueryType\Analysis\Result\ResultList;
/**
......
......@@ -102,8 +102,6 @@ class Field extends ResponseParserAbstract implements ResponseParserInterface
$results = array();
foreach ($typeData as $fieldKey => $fieldData) {
$types = array();
foreach ($fieldData as $typeKey => $typeData) {
......
......@@ -333,6 +333,7 @@ class Query extends BaseQuery
public function clearFieldMappings()
{
$this->fieldMappings = array();
return $this;
}
......@@ -398,6 +399,7 @@ class Query extends BaseQuery
public function createDocument($fields = array(), $boosts = array())
{
$class = $this->getDocumentClass();
return new $class($fields, $boosts);
}
......
......@@ -82,6 +82,7 @@ abstract class Component extends Configurable
public function setQueryInstance(Query $instance)
{
$this->queryInstance = $instance;
return $this;
}
......
......@@ -271,7 +271,6 @@ class Range extends Facet
{
$other = $this->getOption('other');
if ($other === null) $other = array();
return $other;
}
......@@ -303,7 +302,6 @@ class Range extends Facet
{
$include = $this->getOption('include');
if ($include === null) $include = array();
return $include;
}
}
......@@ -518,7 +518,6 @@ class Highlighting extends Component
return $this->getOption('tagpostfix');
}
/**
* Set fragmenter option
*
......
......@@ -200,6 +200,7 @@ class FilterQuery extends Configurable
public function clearTags()
{
$this->tags = array();
return $this;
}
......@@ -214,6 +215,7 @@ class FilterQuery extends Configurable
public function setTags($tags)
{
$this->clearTags();
return $this->addTags($tags);
}
......
......@@ -1081,6 +1081,7 @@ class Query extends BaseQuery
public function setTags($tags)
{
$this->clearTags();
return $this->addTags($tags);
}
......
......@@ -84,11 +84,11 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$correctlySpelled = $value;
break;
case 'collation':
if(!array_key_exists('collation', $value)){
foreach($value as $collationValue) {
if (!array_key_exists('collation', $value)) {
foreach ($value as $collationValue) {
$collations[] = $this->parseCollation($query, $collationValue);
}
}else{
} else {
$collations[] = $this->parseCollation($query, $value);
}
break;
......@@ -113,7 +113,6 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
protected function parseCollation($queryObject, $values)
{
if (is_string($values)) {
return new Collation($values, null, array());
} else {
......@@ -126,7 +125,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
$values = $this->convertToKeyValueArray($values);
}
foreach($values as $key => $value) {
foreach ($values as $key => $value) {
switch ($key) {
case 'collationQuery':
$query = $value;
......
......@@ -121,7 +121,6 @@ class Query extends BaseQuery
{
$value = $this->getOption('fields');
if ($value === null) $value = array();
return $value;
}
......@@ -278,7 +277,6 @@ class Query extends BaseQuery
{
$value = $this->getOption('regexflags');
if ($value === null) $value = array();
return $value;
}
......
......@@ -55,6 +55,7 @@ class ResponseParser extends ResponseParserAbstract implements ResponseParserInt
public function parse($result)
{
$data = $result->getData();
return $this->addHeaderInfo($data, array());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment