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

php-cs-fixer changes

parent fc819735
......@@ -131,8 +131,8 @@ class Curl extends Configurable implements AdapterInterface
* Create curl handle for a request
*
* @throws InvalidArgumentException
* @param Request $request
* @param Endpoint $endpoint
* @param Request $request
* @param Endpoint $endpoint
* @return resource
*/
public function createHandle($request, $endpoint)
......
......@@ -43,7 +43,6 @@ use Solarium\Core\Client\Response;
use Solarium\Core\Client\Endpoint;
use Solarium\Exception\HttpException;
/**
* Basic HTTP adapter using a stream
*/
......@@ -54,8 +53,8 @@ class Http extends Configurable implements AdapterInterface
* Handle Solr communication
*
* @throws HttpException
* @param Request $request
* @param Endpoint $endpoint
* @param Request $request
* @param Endpoint $endpoint
* @return Response
*/
public function execute($request, $endpoint)
......
......@@ -76,8 +76,8 @@ class PeclHttp extends Configurable implements AdapterInterface
* Execute a Solr request using the Pecl Http
*
* @throws HttpException
* @param Request $request
* @param Endpoint $endpoint
* @param Request $request
* @param Endpoint $endpoint
* @return Response
*/
public function execute($request, $endpoint)
......@@ -133,8 +133,8 @@ class PeclHttp extends Configurable implements AdapterInterface
* HTTP Predefined Constant}
*
* @throws InvalidArgumentException
* @param Request $request
* @param Endpoint $endpoint
* @param Request $request
* @param Endpoint $endpoint
* @param HttpRequest
*/
public function toHttpRequest($request, $endpoint)
......
......@@ -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;
/**
......@@ -162,8 +161,8 @@ class ZendHttp extends Configurable implements AdapterInterface
* Execute a Solr request using the Zend_Http_Client instance
*
* @throws HttpException
* @param Request $request
* @param Endpoint $endpoint
* @param Request $request
* @param Endpoint $endpoint
* @return Response
*/
public function execute($request, $endpoint)
......@@ -211,8 +210,8 @@ class ZendHttp extends Configurable implements AdapterInterface
* Prepare a solarium response from the given request and client
* response
*
* @param Request $request
* @param \Zend_Http_Response $response
* @param Request $request
* @param \Zend_Http_Response $response
* @return Response
*/
protected function prepareResponse($request, $response)
......@@ -239,8 +238,8 @@ class ZendHttp extends Configurable implements AdapterInterface
/**
* Prepare the client to send the file and params in request
*
* @param \Zend_Http_Client $client
* @param Request $request
* @param \Zend_Http_Client $client
* @param Request $request
* @return void
*/
protected function prepareFileUpload($client, $request)
......
......@@ -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
*
......@@ -265,8 +264,8 @@ class Client extends Configurable
* In case of options a new endpoint instance wil be created based on the options.
*
* @throws InvalidArgumentException
* @param Endpoint|array $endpoint
* @return self Provides fluent interface
* @param Endpoint|array $endpoint
* @return self Provides fluent interface
*/
public function addEndpoint($endpoint)
{
......@@ -321,7 +320,7 @@ class Client extends Configurable
* Get an endpoint by key
*
* @throws OutOfBoundsException
* @param string $key
* @param string $key
* @return Endpoint
*/
public function getEndpoint($key = null)
......@@ -399,8 +398,8 @@ class Client extends Configurable
*
* All queries executed without a specific endpoint will use this default endpoint.
*
* @param string|Endpoint $endpoint
* @return self Provides fluent interface
* @param string|Endpoint $endpoint
* @return self Provides fluent interface
* @throws OutOfBoundsException
*/
public function setDefaultEndpoint($endpoint)
......@@ -489,7 +488,7 @@ class Client extends Configurable
* If {@see $adapter} doesn't hold an instance a new one will be created by
* calling {@see createAdapter()}
*
* @param boolean $autoload
* @param boolean $autoload
* @return AdapterInterface
*/
public function getAdapter($autoload = true)
......@@ -569,10 +568,10 @@ class Client extends Configurable
* or a manual require.
*
* @throws InvalidArgumentException
* @param string $key
* @param string|PluginInterface $plugin
* @param array $options
* @return self Provides fluent interface
* @param string $key
* @param string|PluginInterface $plugin
* @param array $options
* @return self Provides fluent interface
*/
public function registerPlugin($key, $plugin, $options = array())
{
......@@ -630,8 +629,8 @@ class Client extends Configurable
* Get a plugin instance
*
* @throws OutOfBoundsException
* @param string $key
* @param boolean $autocreate
* @param string $key
* @param boolean $autocreate
* @return PluginInterface|null
*/
public function getPlugin($key, $autocreate = true)
......@@ -657,7 +656,7 @@ class Client extends Configurable
* You can remove a plugin by passing the plugin key, or the plugin instance
*
* @param string|PluginInterface $plugin
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function removePlugin($plugin)
{
......@@ -681,7 +680,7 @@ class Client extends Configurable
* Creates a request based on a query instance
*
* @throws UnexpectedValueException
* @param QueryInterface $query
* @param QueryInterface $query
* @return Request
*/
public function createRequest(QueryInterface $query)
......@@ -711,8 +710,8 @@ class Client extends Configurable
* Creates a result object
*
* @throws UnexpectedValueException;
* @param QueryInterface $query
* @param array Response $response
* @param QueryInterface $query
* @param array Response $response
* @return ResultInterface
*/
public function createResult(QueryInterface $query, $response)
......@@ -959,8 +958,8 @@ class Client extends Configurable
* Create a query instance
*
* @throws InvalidArgumentException|UnexpectedValueException
* @param string $type
* @param array $options
* @param string $type
* @param array $options
* @return \Solarium\Core\Query\Query
*/
public function createQuery($type, $options = null)
......@@ -1083,7 +1082,7 @@ class Client extends Configurable
/**
* Create an extract query instance
*
* @param mixed $options
* @param mixed $options
* @return \Solarium\QueryType\Extract\Query
*/
public function createExtract($options = null)
......
......@@ -324,7 +324,7 @@ class Request extends Configurable
/**
* Set the file to upload via "multipart/form-data" POST request
*
* @param string $filename Name of file to upload
* @param string $filename Name of file to upload
* @return self
*/
public function setFileUpload($filename)
......@@ -334,6 +334,7 @@ class Request extends Configurable
}
$this->setOption('file', $filename);
return $this;
}
......@@ -459,13 +460,15 @@ class Request extends Configurable
*
* If one or both values are NULL authentication will be disabled
*
* @param string $username
* @param string $password
* @return self Provides fluent interface
* @param string $username
* @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;
}
......
......@@ -131,7 +131,7 @@ class Response
* Set headers
*
* @throws HttpException
* @param array $headers
* @param array $headers
* @return void
*/
public function setHeaders($headers)
......
......@@ -66,7 +66,7 @@ class Configurable implements ConfigurableInterface
* After handling the options the {@link _init()} method is called.
*
* @throws InvalidArgumentException
* @param array|\Zend_Config $options
* @param array|\Zend_Config $options
* @return void
*/
public function __construct($options = null)
......@@ -86,8 +86,8 @@ class Configurable implements ConfigurableInterface
* Zend Framework, but can also easily be implemented in any other object.
*
* @throws InvalidArgumentException
* @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false
* @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false
* for merging (new values overwrite old ones if needed)
*
* @return void
......
......@@ -58,7 +58,7 @@ interface ConfigurableInterface
* After handling the options the {@link _init()} method is called.
*
* @throws InvalidArgumentException
* @param array|\Zend_Config $options
* @param array|\Zend_Config $options
* @return void
*/
public function __construct($options = null);
......@@ -71,8 +71,8 @@ interface ConfigurableInterface
* Zend Framework, but can also easily be implemented in any other object.
*
* @throws InvalidArgumentException
* @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false
* @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false
* for merging (new values overwrite old ones if needed)
*
* @return void
......
......@@ -64,8 +64,8 @@ class PostCreateQuery extends Event
/**
* Event constructor
*
* @param string $type
* @param array $query
* @param string $type
* @param array $query
* @param QueryInterface $query
*/
public function __construct($type, $options, QueryInterface $query)
......
......@@ -66,8 +66,8 @@ class PostCreateResult extends Event
/**
* Event constructor
*
* @param QueryInterface $query
* @param Response $response
* @param QueryInterface $query
* @param Response $response
* @param ResultInterface $result
*/
public function __construct(QueryInterface $query, Response $response, ResultInterface $result)
......
......@@ -60,7 +60,7 @@ class PostExecute extends Event
/**
* Event constructor
*
* @param QueryInterface $query
* @param QueryInterface $query
* @param ResultInterface $result
*/
public function __construct(QueryInterface $query, ResultInterface $result)
......
......@@ -66,7 +66,7 @@ class PostExecuteRequest extends Event
/**
* Event constructor
*
* @param Request $request
* @param Request $request
* @param Endpoint $endpoint
* @param Response $response
*/
......
......@@ -64,7 +64,7 @@ class PreCreateQuery extends Event
/**
* Event constructor
*
* @param string $type
* @param string $type
* @param array|null $query
*/
public function __construct($type, $options)
......@@ -86,7 +86,7 @@ class PreCreateQuery extends Event
/**
* Set the query object for this event, this overrides default execution
*
* @param QueryInterface $query
* @param QueryInterface $query
* @return void
*/
public function setQuery($query)
......
......@@ -82,7 +82,7 @@ class PreCreateRequest extends Event
*
* If you set this request value the default execution is skipped and this request is directly returned
*
* @param Request $request
* @param Request $request
* @return void
*/
public function setRequest(Request $request)
......
......@@ -67,7 +67,7 @@ class PreCreateResult extends Event
* Event constructor
*
* @param QueryInterface $query
* @param Response $response
* @param Response $response
*/
public function __construct(QueryInterface $query, Response $response)
{
......@@ -108,7 +108,7 @@ class PreCreateResult extends Event
/**
* Set the result object for this event, overrides default execution
*
* @param ResultInterface $result
* @param ResultInterface $result
* @return void
*/
public function setResult($result)
......
......@@ -90,7 +90,7 @@ class PreExecute extends Event
/**
* Set the result object for this event, overrides default execution
*
* @param ResultInterface $result
* @param ResultInterface $result
* @return void
*/
public function setResult($result)
......
......@@ -66,7 +66,7 @@ class PreExecuteRequest extends Event
/**
* Event constructor
*
* @param Request $request
* @param Request $request
* @param Endpoint $endpoint
*/
public function __construct(Request $request, Endpoint $endpoint)
......@@ -98,7 +98,7 @@ class PreExecuteRequest extends Event
/**
* Get the request object for this event
*
* @param Request $request
* @param Request $request
* @return void
*/
public function setRequest($request)
......@@ -119,7 +119,7 @@ class PreExecuteRequest extends Event
/**
* Set the response object for this event, overrides default execution
*
* @param Response $response
* @param Response $response
* @return void
*/
public function setResponse($response)
......
......@@ -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
......
......@@ -286,9 +286,9 @@ class Helper
* Render a qparser plugin call
*
* @throws InvalidArgumentException
* @param string $name
* @param array $params
* @param boolean $dereferenced
* @param string $name
* @param array $params
* @param boolean $dereferenced
* @return string
*/
public function qparser($name, $params = array(), $dereferenced = false)
......@@ -369,7 +369,7 @@ class Helper
* Render placeholders in a querystring
*
* @throws InvalidArgumentException
* @param array $matches
* @param array $matches
* @return string
*/
protected function renderPlaceHolder($matches)
......
......@@ -180,7 +180,7 @@ abstract class Query extends Configurable implements QueryInterface
* Set responsewriter option
*
* @param string $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setResponseWriter($value)
{
......@@ -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;
......@@ -80,8 +80,8 @@ abstract class ResponseParser
/**
* Parses header data (if available) and adds it to result data
*
* @param array $data
* @param array $result
* @param array $data
* @param array $result
* @return mixed
*/
public function addHeaderInfo($data, $result)
......
......@@ -87,9 +87,9 @@ class Result implements ResultInterface
* Constructor
*
* @throws HttpException
* @param Client $client
* @param Query $query
* @param Response $response
* @param Client $client
* @param Query $query
* @param Response $response
* @return void
*/
public function __construct($client, $query, $response)
......
......@@ -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;
......@@ -134,7 +133,7 @@ class BufferedAdd extends Plugin
* Add a document
*
* @param DocumentInterface $document
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function addDocument($document)
{
......
......@@ -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
*/
......
......@@ -98,7 +98,7 @@ class PreCommit extends Event
/**
* Set the buffer for this event, this way you can alter the buffer before it is committed to Solr
*
* @param array $buffer
* @param array $buffer
* @return void
*/
public function setBuffer($buffer)
......
......@@ -64,9 +64,9 @@ class PreFlush extends Event
/**
* Event constructor
*
* @param array $buffer
* @param array $buffer
* @param boolean $overwrite
* @param int $commitWithin
* @param int $commitWithin
*/
public function __construct($buffer, $overwrite, $commitWithin)
{
......@@ -88,7 +88,7 @@ class PreFlush extends Event
/**
* Set the buffer for this event, this way you can alter the buffer before it is committed to Solr
*
* @param array $buffer
* @param array $buffer
* @return void
*/
public function setBuffer($buffer)
......
......@@ -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;
......@@ -126,8 +125,8 @@ class CustomizeRequest extends Plugin
* Customization instance wil be created based on the options.
*
* @throws InvalidArgumentException
* @param Customization|array $customization
* @return self Provides fluent interface
* @param Customization|array $customization
* @return self Provides fluent interface
*/
public function addCustomization($customization)
{
......
......@@ -60,7 +60,7 @@ class EndpointFailure extends Event
/**
* Constructor
*
* @param Endpoint $endpoint
* @param Endpoint $endpoint
* @param HttpException $exception
*/
public function __construct(Endpoint $endpoint, HttpException $exception)
......@@ -85,5 +85,4 @@ class EndpointFailure extends Event
return $this->exception;
}
}
......@@ -224,9 +224,9 @@ class Loadbalancer extends Plugin
* Add an endpoint to the loadbalacing 'pool'
*
* @throws InvalidArgumentException
* @param Endpoint|string $endpoint
* @param int $weight Must be a positive number
* @return self Provides fluent interface
* @param Endpoint|string $endpoint
* @param int $weight Must be a positive number
* @return self Provides fluent interface
*/
public function addEndpoint($endpoint, $weight = 1)
{
......@@ -456,7 +456,7 @@ class Loadbalancer extends Plugin
/**
* Event hook to adjust client settings just before query execution
*
* @param PreExecuteRequestEvent $event
* @param PreExecuteRequestEvent $event
*/
public function preExecuteRequest(PreExecuteRequestEvent $event)
{
......
......@@ -73,7 +73,7 @@ class WeightedRandomChoice
* Constructor
*
* @throws InvalidArgumentException
* @param array $choices
* @param array $choices
*/
public function __construct($choices)
{
......@@ -95,7 +95,7 @@ class WeightedRandomChoice
* Get a (weighted) random entry
*
* @throws RuntimeException
* @param array $excludes Keys to exclude
* @param array $excludes Keys to exclude
* @return string
*/
public function getRandom($excludes = array())
......@@ -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
......
......@@ -113,7 +113,7 @@ class Document extends Query
* Add multiple documents
*
* @param DocumentInterface[] $documents
* @return self fluent interface
* @return self fluent interface
*/
public function addDocuments($documents)
{
......
......@@ -37,7 +37,6 @@
* @namespace
*/
namespace Solarium\QueryType\Analysis\ResponseParser;
use Solarium\QueryType\Analysis\Result as AnalysisResult;
use Solarium\QueryType\Analysis\Result\ResultList;
/**
......@@ -49,8 +48,8 @@ class Document extends Field
/**
* Parse implementation
*
* @param array $result
* @param array $data
* @param array $result
* @param array $data
* @return ResultList[]
*/
protected function parseAnalysis($result, $data)
......
......@@ -73,8 +73,8 @@ class Field extends ResponseParserAbstract implements ResponseParserInterface
/**
* Parser
*
* @param Result $result
* @param array $data
* @param Result $result
* @param array $data
* @return Types[]
*/
protected function parseAnalysis($result, $data)
......@@ -91,8 +91,8 @@ class Field extends ResponseParserAbstract implements ResponseParserInterface
/**
* Parse analysis types and items
*
* @param Result $result
* @param array $typeData
* @param Result $result
* @param array $typeData
* @return Types[]
*/
protected function parseTypes($result, $typeData)
......@@ -102,8 +102,6 @@ class Field extends ResponseParserAbstract implements ResponseParserInterface
$results = array();
foreach ($typeData as $fieldKey => $fieldData) {
$types = array();
foreach ($fieldData as $typeKey => $typeData) {
......
......@@ -131,7 +131,7 @@ class Query extends BaseQuery
* The fields in the document are indexed together with the generated
* fields that Solr extracts from the file.
*
* @param Document $document
* @param Document $document
* @return self
*/
public function setDocument($document)
......@@ -152,7 +152,7 @@ class Query extends BaseQuery
/**
* Set the file to upload and index
*
* @param string $filename
* @param string $filename
* @return self
*/
public function setFile($filename)
......@@ -173,7 +173,7 @@ class Query extends BaseQuery
/**
* Set the prefix for fields that are not defined in the schema
*
* @param string $uprefix
* @param string $uprefix
* @return self
*/
public function setUprefix($uprefix)
......@@ -195,7 +195,7 @@ class Query extends BaseQuery
* Set the field to use if uprefix is not specified and a field cannot be
* determined
*
* @param string $defaultField
* @param string $defaultField
* @return self
*/
public function setDefaultField($defaultField)
......@@ -218,7 +218,7 @@ class Query extends BaseQuery
* Set if all field names should be mapped to lowercase with underscores.
* For example, Content-Type would be mapped to content_type.
*
* @param bool $lowerNames
* @param bool $lowerNames
* @return self
*/
public function setLowernames($lowerNames)
......@@ -239,7 +239,7 @@ class Query extends BaseQuery
/**
* Set if the extract should be committed immediately
*
* @param bool $commit
* @param bool $commit
* @return self Provides fluent interface
*/
public function setCommit($commit)
......@@ -260,7 +260,7 @@ class Query extends BaseQuery
/**
* Set milliseconds until extract update is committed. Since Solr 3.4
*
* @param int $commitWithin
* @param int $commitWithin
* @return self Provides fluent interface
*/
public function setCommitWithin($commitWithin)
......@@ -284,9 +284,9 @@ class Query extends BaseQuery
* Example: fmap.content=text will cause the content field normally
* generated by Tika to be moved to the "text" field.
*
* @param string $fromField Original field name
* @param mixed|array $toField New field name
* @return self Provides fluent interface
* @param string $fromField Original field name
* @param mixed|array $toField New field name
* @return self Provides fluent interface
*/
public function addFieldMapping($fromField, $toField)
{
......@@ -298,8 +298,8 @@ class Query extends BaseQuery
/**
* Add multiple field name mappings
*
* @param array $mappings Name mapping in the form [$fromField => $toField, ...]
* @return self Provides fluent interface
* @param array $mappings Name mapping in the form [$fromField => $toField, ...]
* @return self Provides fluent interface
*/
public function addFieldMappings($mappings)
{
......@@ -313,8 +313,8 @@ class Query extends BaseQuery
/**
* Remove a field name mapping
*
* @param string $fromField
* @return self Provides fluent interface
* @param string $fromField
* @return self Provides fluent interface
*/
public function removeFieldMapping($fromField)
{
......@@ -333,6 +333,7 @@ class Query extends BaseQuery
public function clearFieldMappings()
{
$this->fieldMappings = array();
return $this;
}
......@@ -349,8 +350,8 @@ class Query extends BaseQuery
/**
* Set many field name mappings. This overwrites any existing fields.
*
* @param array $mappings Name mapping in the form [$fromField => $toField, ...]
* @return self Provides fluent interface
* @param array $mappings Name mapping in the form [$fromField => $toField, ...]
* @return self Provides fluent interface
*/
public function setFieldMappings($mappings)
{
......@@ -398,6 +399,7 @@ class Query extends BaseQuery
public function createDocument($fields = array(), $boosts = array())
{
$class = $this->getDocumentClass();
return new $class($fields, $boosts);
}
......
......@@ -58,7 +58,7 @@ class RequestBuilder extends BaseRequestBuilder
/**
* Build the request
*
* @param Query $query
* @param Query $query
* @return Request
*/
public function build(QueryInterface $query)
......
......@@ -183,7 +183,7 @@ class Query extends SelectQuery
* Separate multiple fields with commas if you use string input.
*
* @param string|array $fields
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setMltFields($fields)
{
......@@ -381,7 +381,7 @@ class Query extends SelectQuery
* Separate multiple fields with commas if you use string input.
*
* @param string|array $queryFields
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setQueryFields($queryFields)
{
......
......@@ -82,6 +82,7 @@ abstract class Component extends Configurable
public function setQueryInstance(Query $instance)
{
$this->queryInstance = $instance;
return $this;
}
......
......@@ -122,8 +122,8 @@ class MultiQuery extends Facet
* facetquery instance wil be created based on the options.
*
* @throws InvalidArgumentException
* @param Query|array $facetQuery
* @return self Provides fluent interface
* @param Query|array $facetQuery
* @return self Provides fluent interface
*/
public function addQuery($facetQuery)
{
......
......@@ -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;
}
}
......@@ -280,8 +280,8 @@ class FacetSet extends Component
* Add a facet
*
* @throws InvalidArgumentException
* @param Facet\Facet|array $facet
* @return self Provides fluent interface
* @param Facet\Facet|array $facet
* @return self Provides fluent interface
*/
public function addFacet($facet)
{
......@@ -409,9 +409,9 @@ class FacetSet extends Component
* after setting the key, by using the addFacet method.
*
* @throws OutOfBoundsException
* @param string $type
* @param array|object|null $options
* @param boolean $add
* @param string $type
* @param array|object|null $options
* @param boolean $add
* @return Facet\Facet
*/
public function createFacet($type, $options = null, $add = true)
......@@ -441,8 +441,8 @@ class FacetSet extends Component
/**
* Get a facet field instance
*
* @param mixed $options
* @param bool $add
* @param mixed $options
* @param bool $add
* @return Facet\Field
*/
public function createFacetField($options = null, $add = true)
......@@ -453,8 +453,8 @@ class FacetSet extends Component
/**
* Get a facet query instance
*
* @param mixed $options
* @param bool $add
* @param mixed $options
* @param bool $add
* @return Facet\Query
*/
public function createFacetQuery($options = null, $add = true)
......@@ -465,8 +465,8 @@ class FacetSet extends Component
/**
* Get a facet multiquery instance
*
* @param mixed $options
* @param bool $add
* @param mixed $options
* @param bool $add
* @return Facet\MultiQuery
*/
public function createFacetMultiQuery($options = null, $add = true)
......@@ -477,8 +477,8 @@ class FacetSet extends Component
/**
* Get a facet range instance
*
* @param mixed $options
* @param bool $add
* @param mixed $options
* @param bool $add
* @return Facet\Range
*/
public function createFacetRange($options = null, $add = true)
......
......@@ -447,7 +447,7 @@ class Grouping extends Component
* Group based on the unique values of a function query. Only available in Solr 4.0+
*
* @param string $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setFunction($value)
{
......@@ -471,7 +471,7 @@ class Grouping extends Component
* This parameter only is supported on Solr 4.0+
*
* @param string $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setFacet($value)
{
......@@ -495,7 +495,7 @@ class Grouping extends Component
* The start and rows parameters refer to numbers of documents instead of numbers of groups.
*
* @param string $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setFormat($value)
{
......
......@@ -139,8 +139,8 @@ class Highlighting extends Component
* Add a field for highlighting
*
* @throws InvalidArgumentException
* @param string|array|Field $field
* @return self Provides fluent interface
* @param string|array|Field $field
* @return self Provides fluent interface
*/
public function addField($field)
{
......@@ -473,8 +473,8 @@ class Highlighting extends Component
*
* Solr option h1.tag.post
*
* @param string $prefix
* @return self Provides fluent interface
* @param string $prefix
* @return self Provides fluent interface
*/
public function setTagPrefix($prefix)
{
......@@ -498,8 +498,8 @@ class Highlighting extends Component
*
* Solr option h1.tag.post
*
* @param string $postfix
* @return self Provides fluent interface
* @param string $postfix
* @return self Provides fluent interface
*/
public function setTagPostfix($postfix)
{
......@@ -518,7 +518,6 @@ class Highlighting extends Component
return $this->getOption('tagpostfix');
}
/**
* Set fragmenter option
*
......@@ -757,8 +756,8 @@ class Highlighting extends Component
/**
* Set MultiValuedSeparatorChar option
*
* @param string $separator
* @return self Provides fluent interface
* @param string $separator
* @return self Provides fluent interface
*/
public function setMultiValuedSeparatorChar($separator)
{
......
......@@ -88,7 +88,7 @@ class MoreLikeThis extends Component
* When using string input you can separate multiple fields with commas.
*
* @param string|array $fields
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setFields($fields)
{
......
......@@ -153,8 +153,8 @@ class Stats extends Component
* field instance wil be created based on the options.
*
* @throws InvalidArgumentException
* @param Field|array $field
* @return self Provides fluent interface
* @param Field|array $field
* @return self Provides fluent interface
*/
public function addField($field)
{
......
......@@ -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);
}
......
......@@ -642,8 +642,8 @@ class Query extends BaseQuery
* filterquery instance wil be created based on the options.
*
* @throws InvalidArgumentException
* @param FilterQuery|array $filterQuery
* @return self Provides fluent interface
* @param FilterQuery|array $filterQuery
* @return self Provides fluent interface
*/
public function addFilterQuery($filterQuery)
{
......@@ -801,9 +801,9 @@ class Query extends BaseQuery
* instance if there is no registered component for the given key yet.
*
* @throws OutOfBoundsException
* @param string $key Use one of the constants
* @param string $autoload Class to autoload if component needs to be created
* @param array $config Configuration to use for autoload
* @param string $key Use one of the constants
* @param string $autoload Class to autoload if component needs to be created
* @param array $config Configuration to use for autoload
* @return object|null
*/
public function getComponent($key, $autoload = false, $config = null)
......@@ -834,9 +834,9 @@ class Query extends BaseQuery
*
* This overwrites any existing component registered with the same key.
*
* @param string $key
* @param string $key
* @param Component $component
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setComponent($key, $component)
{
......@@ -1081,6 +1081,7 @@ class Query extends BaseQuery
public function setTags($tags)
{
$this->clearTags();
return $this->addTags($tags);
}
......
......@@ -47,7 +47,7 @@ interface ComponentRequestBuilderInterface
* Add request settings for the debug component
*
* @param Component $component
* @param Request $request
* @param Request $request
* @return Request
*/
public function buildComponent($component, $request);
......
......@@ -56,8 +56,8 @@ class FacetSet extends RequestBuilder implements ComponentRequestBuilderInterfac
* Add request settings for FacetSet
*
* @throws UnexpectedValueException
* @param FacetsetComponent $component
* @param Request $request
* @param FacetsetComponent $component
* @param Request $request
* @return Request
*/
public function buildComponent($component, $request)
......
......@@ -45,9 +45,9 @@ interface ComponentParserInterface
/**
* Parse result data into result objects
*
* @param Query $query
* @param object $component
* @param array $data
* @param Query $query
* @param object $component
* @param array $data
* @return object|null
*/
public function parse($query, $component, $data);
......
......@@ -55,9 +55,9 @@ class Debug implements ComponentParserInterface
/**
* Parse result data into result objects
*
* @param Query $query
* @param DebugComponent $component
* @param array $data
* @param Query $query
* @param DebugComponent $component
* @param array $data
* @return Result|null
*/
public function parse($query, $component, $data)
......@@ -124,7 +124,7 @@ class Debug implements ComponentParserInterface
*
* Used for explain and explainOther
*
* @param array $data
* @param array $data
* @return DocumentSet
*/
protected function parseDocumentSet($data)
......@@ -158,8 +158,8 @@ class Debug implements ComponentParserInterface
/**
* Parse raw timing phase data into a result class
*
* @param string $name
* @param array $data
* @param string $name
* @param array $data
* @return TimingPhase
*/
protected function parseTimingPhase($name, $data)
......
......@@ -61,9 +61,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
* Parse result data into result objects
*
* @throws RuntimeException
* @param Query $query
* @param QueryFacetSet $facetSet
* @param array $data
* @param Query $query
* @param QueryFacetSet $facetSet
* @param array $data
* @return ResultFacetSet
*/
public function parse($query, $facetSet, $data)
......@@ -109,9 +109,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/**
* Add a facet result for a field facet
*
* @param Query $query
* @param Query $query
* @param QueryFacetField $facet
* @param array $data
* @param array $data
* @return ResultFacetField
*/
protected function facetField($query, $facet, $data)
......@@ -131,7 +131,7 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
* Add a facet result for a facet query
*
* @param QueryFacetQuery $facet
* @param array $data
* @param array $data
* @return ResultFacetQuery
*/
protected function facetQuery($facet, $data)
......@@ -149,7 +149,7 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
* Add a facet result for a multiquery facet
*
* @param QueryFacetMultiQuery $facet
* @param array $data
* @param array $data
* @return ResultFacetMultiQuery
*/
protected function facetMultiQuery($facet, $data)
......@@ -171,9 +171,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/**
* Add a facet result for a range facet
*
* @param Query $query
* @param Query $query
* @param QueryFacetRange $facet
* @param array $data
* @param array $data
* @return ResultFacetRange
*/
protected function facetRange($query, $facet, $data)
......
......@@ -53,9 +53,9 @@ class Grouping implements ComponentParserInterface
/**
* Parse result data into result objects
*
* @param Query $query
* @param GroupingComponent $grouping
* @param array $data
* @param Query $query
* @param GroupingComponent $grouping
* @param array $data
* @return Result
*/
public function parse($query, $grouping, $data)
......
......@@ -51,9 +51,9 @@ class Highlighting implements ComponentParserInterface
/**
* Parse result data into result objects
*
* @param Query $query
* @param HighlightingComponent $highlighting
* @param array $data
* @param Query $query
* @param HighlightingComponent $highlighting
* @param array $data
* @return HighlightingResult
*/
public function parse($query, $highlighting, $data)
......
......@@ -51,9 +51,9 @@ class MoreLikeThis implements ComponentParserInterface
/**
* Parse result data into result objects
*
* @param Query $query
* @param MoreLikeThisComponent $moreLikeThis
* @param array $data
* @param Query $query
* @param MoreLikeThisComponent $moreLikeThis
* @param array $data
* @return MoreLikeThis
*/
public function parse($query, $moreLikeThis, $data)
......
......@@ -55,9 +55,9 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/**
* Parse result data into result objects
*
* @param Query $query
* @param SpellcheckComponent $spellcheck
* @param array $data
* @param Query $query
* @param SpellcheckComponent $spellcheck
* @param array $data
* @return Result|null
*/
public function parse($query, $spellcheck, $data)
......@@ -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;
......@@ -106,14 +106,13 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/**
* Parse collation data into a result object
*
* @param Query $queryObject
* @param array $values
* @param Query $queryObject
* @param array $values
* @return Collation
*/
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;
......@@ -159,8 +158,8 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/**
* Parse suggestion data into a result object
*
* @param string $key
* @param array $value
* @param string $key
* @param array $value
* @return Suggestion
*/
protected function parseSuggestion($key, $value)
......
......@@ -53,7 +53,7 @@ class ResponseParser extends ResponseParserAbstract implements ResponseParserInt
* Get result data for the response
*
* @throws RuntimeException
* @param Result $result
* @param Result $result
* @return array
*/
public function parse($result)
......
......@@ -72,8 +72,8 @@ class Document extends AbstractDocument implements DocumentInterface
* is a readonly document an exception will be thrown to prevent this.
*
* @throws RuntimeException
* @param string $name
* @param string $value
* @param string $name
* @param string $value
* @return void
*/
public function __set($name, $value)
......
......@@ -100,7 +100,7 @@ class Query extends BaseQuery
* For multiple fields use a comma-separated string or array
*
* @param string|array $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setFields($value)
{
......@@ -121,7 +121,6 @@ class Query extends BaseQuery
{
$value = $this->getOption('fields');
if ($value === null) $value = array();
return $value;
}
......@@ -257,7 +256,7 @@ class Query extends BaseQuery
* Use a comma-separated string or array for multiple entries
*
* @param string|array $value
* @return self Provides fluent interface
* @return self Provides fluent interface
*/
public function setRegexFlags($value)
{
......@@ -278,7 +277,6 @@ class Query extends BaseQuery
{
$value = $this->getOption('regexflags');
if ($value === null) $value = array();
return $value;
}
......
......@@ -51,7 +51,7 @@ class ResponseParser extends ResponseParserAbstract implements ResponseParserInt
/**
* Get result data for the response
*
* @param Result $result
* @param Result $result
* @return array
*/
public function parse($result)
......
......@@ -70,8 +70,8 @@ class Add extends Command
* Add a single document
*
* @throws RuntimeException
* @param Document $document
* @return self Provides fluent interface
* @param Document $document
* @return self Provides fluent interface
*/
public function addDocument($document)
{
......
......@@ -182,8 +182,8 @@ class Query extends BaseQuery
* Create a command instance
*
* @throws InvalidArgumentException
* @param string $type
* @param mixed $options
* @param string $type
* @param mixed $options
* @return Command
*/
public function createCommand($type, $options = null)
......
......@@ -70,7 +70,7 @@ class RequestBuilder extends BaseRequestBuilder
*
* Each commandtype is delegated to a separate builder method.
*
* @param UpdateQuery $query
* @param UpdateQuery $query
* @throws RuntimeException
* @return string
*/
......
......@@ -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