Commit ac46a00b authored by Bas de Nooijer's avatar Bas de Nooijer

Merge branch 'psr-2-fixes' of github.com:smoench/solarium into develop

Conflicts:
	library/Solarium/Plugin/BufferedAdd/BufferedAdd.php
parents 31a011ce 260818e4
...@@ -161,8 +161,8 @@ class ZendHttp extends Configurable implements AdapterInterface ...@@ -161,8 +161,8 @@ class ZendHttp extends Configurable implements AdapterInterface
* *
* @throws HttpException * @throws HttpException
* @throws OutOfBoundsException * @throws OutOfBoundsException
* @param Request $request * @param Request $request
* @param Endpoint $endpoint * @param Endpoint $endpoint
* @return Response * @return Response
*/ */
public function execute($request, $endpoint) public function execute($request, $endpoint)
......
...@@ -769,8 +769,8 @@ class Client extends Configurable ...@@ -769,8 +769,8 @@ class Client extends Configurable
/** /**
* Execute a query * Execute a query
* *
* @param QueryInterface $query * @param QueryInterface $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return ResultInterface * @return ResultInterface
*/ */
public function execute(QueryInterface $query, $endpoint = null) public function execute(QueryInterface $query, $endpoint = null)
...@@ -838,8 +838,8 @@ class Client extends Configurable ...@@ -838,8 +838,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Ping\Query $query * @param QueryInterface|\Solarium\QueryType\Ping\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Ping\Result * @return \Solarium\QueryType\Ping\Result
*/ */
public function ping(QueryInterface $query, $endpoint = null) public function ping(QueryInterface $query, $endpoint = null)
...@@ -864,8 +864,8 @@ class Client extends Configurable ...@@ -864,8 +864,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Update\Query\Query $query * @param QueryInterface|\Solarium\QueryType\Update\Query\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Update\Result * @return \Solarium\QueryType\Update\Result
*/ */
public function update(QueryInterface $query, $endpoint = null) public function update(QueryInterface $query, $endpoint = null)
...@@ -889,8 +889,8 @@ class Client extends Configurable ...@@ -889,8 +889,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Select\Query\Query $query * @param QueryInterface|\Solarium\QueryType\Select\Query\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Select\Result\Result * @return \Solarium\QueryType\Select\Result\Result
*/ */
public function select(QueryInterface $query, $endpoint = null) public function select(QueryInterface $query, $endpoint = null)
...@@ -914,8 +914,8 @@ class Client extends Configurable ...@@ -914,8 +914,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\MoreLikeThis\Query $query * @param QueryInterface|\Solarium\QueryType\MoreLikeThis\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\MoreLikeThis\Result * @return \Solarium\QueryType\MoreLikeThis\Result
*/ */
public function moreLikeThis(QueryInterface $query, $endpoint = null) public function moreLikeThis(QueryInterface $query, $endpoint = null)
...@@ -929,8 +929,8 @@ class Client extends Configurable ...@@ -929,8 +929,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Analysis\Query\Document|\Solarium\QueryType\Analysis\Query\Field $query * @param QueryInterface|\Solarium\QueryType\Analysis\Query\Document|\Solarium\QueryType\Analysis\Query\Field $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Analysis\Result\Document|\Solarium\QueryType\Analysis\Result\Field * @return \Solarium\QueryType\Analysis\Result\Document|\Solarium\QueryType\Analysis\Result\Field
*/ */
public function analyze(QueryInterface $query, $endpoint = null) public function analyze(QueryInterface $query, $endpoint = null)
...@@ -944,8 +944,8 @@ class Client extends Configurable ...@@ -944,8 +944,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Terms\Query $query * @param QueryInterface|\Solarium\QueryType\Terms\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Terms\Result * @return \Solarium\QueryType\Terms\Result
*/ */
public function terms(QueryInterface $query, $endpoint = null) public function terms(QueryInterface $query, $endpoint = null)
...@@ -959,8 +959,8 @@ class Client extends Configurable ...@@ -959,8 +959,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Suggester\Query $query * @param QueryInterface|\Solarium\QueryType\Suggester\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Suggester\Result\Result * @return \Solarium\QueryType\Suggester\Result\Result
*/ */
public function suggester(QueryInterface $query, $endpoint = null) public function suggester(QueryInterface $query, $endpoint = null)
...@@ -974,8 +974,8 @@ class Client extends Configurable ...@@ -974,8 +974,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\Extract\Query $query * @param QueryInterface|\Solarium\QueryType\Extract\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\Extract\Result * @return \Solarium\QueryType\Extract\Result
*/ */
public function extract(QueryInterface $query, $endpoint = null) public function extract(QueryInterface $query, $endpoint = null)
...@@ -989,8 +989,8 @@ class Client extends Configurable ...@@ -989,8 +989,8 @@ class Client extends Configurable
* @internal This is a convenience method that forwards the query to the * @internal This is a convenience method that forwards the query to the
* execute method, thus allowing for an easy to use and clean API. * execute method, thus allowing for an easy to use and clean API.
* *
* @param QueryInterface|\Solarium\QueryType\RealtimeGet\Query $query * @param QueryInterface|\Solarium\QueryType\RealtimeGet\Query $query
* @param Endpoint|string|null $endpoint * @param Endpoint|string|null $endpoint
* @return \Solarium\QueryType\RealtimeGet\Result * @return \Solarium\QueryType\RealtimeGet\Result
*/ */
public function realtimeGet(QueryInterface $query, $endpoint = null) public function realtimeGet(QueryInterface $query, $endpoint = null)
...@@ -1137,7 +1137,7 @@ class Client extends Configurable ...@@ -1137,7 +1137,7 @@ class Client extends Configurable
/** /**
* Create a RealtimeGet query instance * Create a RealtimeGet query instance
* *
* @param mixed $options * @param mixed $options
* @return \Solarium\QueryType\RealtimeGet\Query * @return \Solarium\QueryType\RealtimeGet\Query
*/ */
public function createRealtimeGet($options = null) public function createRealtimeGet($options = null)
......
...@@ -325,7 +325,7 @@ class Request extends Configurable ...@@ -325,7 +325,7 @@ class Request extends Configurable
* Set the file to upload via "multipart/form-data" POST request * Set the file to upload via "multipart/form-data" POST request
* *
* @throws RuntimeException * @throws RuntimeException
* @param string $filename Name of file to upload * @param string $filename Name of file to upload
* @return self * @return self
*/ */
public function setFileUpload($filename) public function setFileUpload($filename)
......
...@@ -87,7 +87,7 @@ class Configurable implements ConfigurableInterface ...@@ -87,7 +87,7 @@ class Configurable implements ConfigurableInterface
* @throws InvalidArgumentException * @throws InvalidArgumentException
* @param array|\Zend_Config $options * @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false * @param boolean $overwrite True for overwriting existing options, false
* for merging (new values overwrite old ones if needed) * for merging (new values overwrite old ones if needed)
* *
* @return void * @return void
*/ */
......
...@@ -60,7 +60,7 @@ interface ConfigurableInterface ...@@ -60,7 +60,7 @@ interface ConfigurableInterface
* @throws InvalidArgumentException * @throws InvalidArgumentException
* @param array|\Zend_Config $options * @param array|\Zend_Config $options
* @param boolean $overwrite True for overwriting existing options, false * @param boolean $overwrite True for overwriting existing options, false
* for merging (new values overwrite old ones if needed) * for merging (new values overwrite old ones if needed)
* *
* @return void * @return void
*/ */
......
...@@ -40,7 +40,6 @@ namespace Solarium\Core\Plugin; ...@@ -40,7 +40,6 @@ namespace Solarium\Core\Plugin;
use Solarium\Core\Client\Client; use Solarium\Core\Client\Client;
use Solarium\Core\Configurable; use Solarium\Core\Configurable;
use Solarium\Core\Query\Query;
/** /**
* Base class for plugins * Base class for plugins
......
...@@ -40,7 +40,6 @@ namespace Solarium\Core\Plugin; ...@@ -40,7 +40,6 @@ namespace Solarium\Core\Plugin;
use Solarium\Core\ConfigurableInterface; use Solarium\Core\ConfigurableInterface;
use Solarium\Core\Client\Client; use Solarium\Core\Client\Client;
use Solarium\Core\Query\Query;
/** /**
* Interface for plugins * Interface for plugins
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
*/ */
namespace Solarium\Core\Query; namespace Solarium\Core\Query;
use Solarium\Core\Query\Query;
use Solarium\Exception\InvalidArgumentException; use Solarium\Exception\InvalidArgumentException;
/** /**
...@@ -358,6 +357,7 @@ class Helper ...@@ -358,6 +357,7 @@ class Helper
foreach ($params as $key => $value) { foreach ($params as $key => $value) {
$this->query->addParam($key, $value); $this->query->addParam($key, $value);
} }
return $name . '()'; return $name . '()';
} else { } else {
return $name . '(' . implode($params, ',') . ')'; return $name . '(' . implode($params, ',') . ')';
...@@ -454,8 +454,8 @@ class Helper ...@@ -454,8 +454,8 @@ class Helper
* *
* @see http://wiki.apache.org/solr/SolrQuerySyntax#Other_built-in_useful_query_parsers * @see http://wiki.apache.org/solr/SolrQuerySyntax#Other_built-in_useful_query_parsers
* *
* @param string $field * @param string $field
* @param float $weight * @param float $weight
* @return string * @return string
*/ */
public function qparserTerm($field, $weight) public function qparserTerm($field, $weight)
...@@ -470,8 +470,8 @@ class Helper ...@@ -470,8 +470,8 @@ class Helper
* *
* @see http://wiki.apache.org/solr/CommonQueryParameters#Caching_of_filters * @see http://wiki.apache.org/solr/CommonQueryParameters#Caching_of_filters
* *
* @param boolean $useCache * @param boolean $useCache
* @param float|null $cost * @param float|null $cost
* @return string * @return string
*/ */
public function cacheControl($useCache, $cost = null) public function cacheControl($useCache, $cost = null)
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
*/ */
namespace Solarium\Core\Query; namespace Solarium\Core\Query;
use Solarium\Core\Query\Helper;
use Solarium\Core\Configurable; use Solarium\Core\Configurable;
/** /**
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
*/ */
namespace Solarium\Core\Query; namespace Solarium\Core\Query;
use Solarium\Core\Query\Helper;
use Solarium\Core\ConfigurableInterface; use Solarium\Core\ConfigurableInterface;
/** /**
......
...@@ -38,9 +38,7 @@ ...@@ -38,9 +38,7 @@
*/ */
namespace Solarium\Core\Query; namespace Solarium\Core\Query;
use Solarium\Core\Query\Query;
use Solarium\Core\Client\Request; use Solarium\Core\Client\Request;
use Solarium\Core\Query\QueryInterface;
/** /**
* Class for building Solarium client requests * Class for building Solarium client requests
......
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
*/ */
namespace Solarium\Core\Query; namespace Solarium\Core\Query;
use Solarium\Core\Query\QueryInterface;
use Solarium\Core\Client\Request; use Solarium\Core\Client\Request;
/** /**
......
...@@ -485,8 +485,8 @@ class Loadbalancer extends Plugin ...@@ -485,8 +485,8 @@ class Loadbalancer extends Plugin
* Execute a request using the adapter * Execute a request using the adapter
* *
* @throws RuntimeException * @throws RuntimeException
* @param Request $request * @param Request $request
* @return Response $response * @return Response $response
*/ */
protected function getLoadbalancedResponse($request) protected function getLoadbalancedResponse($request)
{ {
......
...@@ -52,7 +52,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -52,7 +52,7 @@ class RequestBuilder extends BaseRequestBuilder
/** /**
* Build request for an analysis query * Build request for an analysis query
* *
* @param QueryInterface|Query $query * @param QueryInterface|Query $query
* @return Request * @return Request
*/ */
public function build(QueryInterface $query) public function build(QueryInterface $query)
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
namespace Solarium\QueryType\Analysis\Result; namespace Solarium\QueryType\Analysis\Result;
use Solarium\Core\Query\Result\QueryType as BaseResult; use Solarium\Core\Query\Result\QueryType as BaseResult;
use Solarium\QueryType\Analysis\Result\ResultList;
/** /**
* Analysis document query result * Analysis document query result
......
...@@ -413,8 +413,8 @@ class Query extends BaseQuery ...@@ -413,8 +413,8 @@ class Query extends BaseQuery
* You can optionally directly supply the fields and boosts * You can optionally directly supply the fields and boosts
* to get a ready-made document instance for direct use in an add command * to get a ready-made document instance for direct use in an add command
* *
* @param array $fields * @param array $fields
* @param array $boosts * @param array $boosts
* @return DocumentInterface * @return DocumentInterface
*/ */
public function createDocument($fields = array(), $boosts = array()) public function createDocument($fields = array(), $boosts = array())
......
...@@ -42,7 +42,6 @@ namespace Solarium\QueryType\MoreLikeThis; ...@@ -42,7 +42,6 @@ namespace Solarium\QueryType\MoreLikeThis;
use Solarium\QueryType\Select\Result\Document as ReadOnlyDocument; use Solarium\QueryType\Select\Result\Document as ReadOnlyDocument;
use Solarium\QueryType\Select\Result\Result as SelectResult; use Solarium\QueryType\Select\Result\Result as SelectResult;
use Solarium\Exception\UnexpectedValueException; use Solarium\Exception\UnexpectedValueException;
use Solarium\QueryType\MoreLikeThis\Query;
/** /**
* MoreLikeThis query result * MoreLikeThis query result
......
...@@ -50,7 +50,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -50,7 +50,7 @@ class RequestBuilder extends BaseRequestBuilder
/** /**
* Build request for a ping query * Build request for a ping query
* *
* @param QueryInterface|Query $query * @param QueryInterface|Query $query
* @return Request * @return Request
*/ */
public function build(QueryInterface $query) public function build(QueryInterface $query)
......
...@@ -56,6 +56,7 @@ class Result extends BaseResult implements \IteratorAggregate, \Countable ...@@ -56,6 +56,7 @@ class Result extends BaseResult implements \IteratorAggregate, \Countable
public function getDocument() public function getDocument()
{ {
$docs = $this->getDocuments(); $docs = $this->getDocuments();
return reset($docs); return reset($docs);
} }
} }
...@@ -249,7 +249,7 @@ class DistributedSearch extends Component ...@@ -249,7 +249,7 @@ class DistributedSearch extends Component
/** /**
* Add a collection * Add a collection
* *
* @param string $key unique string * @param string $key unique string
* @param string $collection The syntax is host:port/base_url * @param string $collection The syntax is host:port/base_url
* @return self Provides fluent interface * @return self Provides fluent interface
* @link http://wiki.apache.org/solr/SolrCloud/ * @link http://wiki.apache.org/solr/SolrCloud/
......
...@@ -97,7 +97,6 @@ class Pivot extends Facet ...@@ -97,7 +97,6 @@ class Pivot extends Facet
return $this->getOption('mincount'); return $this->getOption('mincount');
} }
/** /**
* Specify a field to return in the resultset * Specify a field to return in the resultset
* *
...@@ -116,7 +115,7 @@ class Pivot extends Facet ...@@ -116,7 +115,7 @@ class Pivot extends Facet
* Specify multiple fields to return in the resultset * Specify multiple fields to return in the resultset
* *
* @param string|array $fields can be an array or string with comma * @param string|array $fields can be an array or string with comma
* separated fieldnames * separated fieldnames
* *
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
......
...@@ -159,8 +159,8 @@ class FacetSet extends Component ...@@ -159,8 +159,8 @@ class FacetSet extends Component
* Allow extraction of facets without having to define * Allow extraction of facets without having to define
* them on the query * them on the query
* *
* @param boolean $extract * @param boolean $extract
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setExtractFromResponse($extract) public function setExtractFromResponse($extract)
{ {
...@@ -437,9 +437,9 @@ class FacetSet extends Component ...@@ -437,9 +437,9 @@ class FacetSet extends Component
* after setting the key, by using the addFacet method. * after setting the key, by using the addFacet method.
* *
* @throws OutOfBoundsException * @throws OutOfBoundsException
* @param string $type * @param string $type
* @param array|object|null $options * @param array|object|null $options
* @param boolean $add * @param boolean $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Facet * @return \Solarium\QueryType\Select\Query\Component\Facet\Facet
*/ */
public function createFacet($type, $options = null, $add = true) public function createFacet($type, $options = null, $add = true)
...@@ -470,8 +470,8 @@ class FacetSet extends Component ...@@ -470,8 +470,8 @@ class FacetSet extends Component
/** /**
* Get a facet field instance * Get a facet field instance
* *
* @param mixed $options * @param mixed $options
* @param bool $add * @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Field * @return \Solarium\QueryType\Select\Query\Component\Facet\Field
*/ */
public function createFacetField($options = null, $add = true) public function createFacetField($options = null, $add = true)
...@@ -482,8 +482,8 @@ class FacetSet extends Component ...@@ -482,8 +482,8 @@ class FacetSet extends Component
/** /**
* Get a facet query instance * Get a facet query instance
* *
* @param mixed $options * @param mixed $options
* @param bool $add * @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Query * @return \Solarium\QueryType\Select\Query\Component\Facet\Query
*/ */
public function createFacetQuery($options = null, $add = true) public function createFacetQuery($options = null, $add = true)
...@@ -494,8 +494,8 @@ class FacetSet extends Component ...@@ -494,8 +494,8 @@ class FacetSet extends Component
/** /**
* Get a facet multiquery instance * Get a facet multiquery instance
* *
* @param mixed $options * @param mixed $options
* @param bool $add * @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\MultiQuery * @return \Solarium\QueryType\Select\Query\Component\Facet\MultiQuery
*/ */
public function createFacetMultiQuery($options = null, $add = true) public function createFacetMultiQuery($options = null, $add = true)
...@@ -506,8 +506,8 @@ class FacetSet extends Component ...@@ -506,8 +506,8 @@ class FacetSet extends Component
/** /**
* Get a facet range instance * Get a facet range instance
* *
* @param mixed $options * @param mixed $options
* @param bool $add * @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Range * @return \Solarium\QueryType\Select\Query\Component\Facet\Range
*/ */
public function createFacetRange($options = null, $add = true) public function createFacetRange($options = null, $add = true)
...@@ -518,8 +518,8 @@ class FacetSet extends Component ...@@ -518,8 +518,8 @@ class FacetSet extends Component
/** /**
* Get a facet pivot instance * Get a facet pivot instance
* *
* @param mixed $options * @param mixed $options
* @param bool $add * @param bool $add
* @return \Solarium\QueryType\Select\Query\Component\Facet\Pivot * @return \Solarium\QueryType\Select\Query\Component\Facet\Pivot
*/ */
public function createFacetPivot($options = null, $add = true) public function createFacetPivot($options = null, $add = true)
......
...@@ -188,7 +188,7 @@ class Highlighting extends Component ...@@ -188,7 +188,7 @@ class Highlighting extends Component
* Add multiple fields for highlighting * Add multiple fields for highlighting
* *
* @param string|array $fields can be an array of object instances or a string with comma * @param string|array $fields can be an array of object instances or a string with comma
* separated fieldnames * separated fieldnames
* *
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
...@@ -842,8 +842,8 @@ class Highlighting extends Component ...@@ -842,8 +842,8 @@ class Highlighting extends Component
/** /**
* Set boundaryscannerchars option * Set boundaryscannerchars option
* *
* @param string $chars * @param string $chars
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setBoundaryScannerChars($chars) public function setBoundaryScannerChars($chars)
{ {
...@@ -863,8 +863,8 @@ class Highlighting extends Component ...@@ -863,8 +863,8 @@ class Highlighting extends Component
/** /**
* Set boundaryscannertype option * Set boundaryscannertype option
* *
* @param string $type * @param string $type
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setBoundaryScannerType($type) public function setBoundaryScannerType($type)
{ {
...@@ -884,8 +884,8 @@ class Highlighting extends Component ...@@ -884,8 +884,8 @@ class Highlighting extends Component
/** /**
* Set boundaryscannerlanguage option * Set boundaryscannerlanguage option
* *
* @param string $language * @param string $language
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setBoundaryScannerLanguage($language) public function setBoundaryScannerLanguage($language)
{ {
...@@ -905,8 +905,8 @@ class Highlighting extends Component ...@@ -905,8 +905,8 @@ class Highlighting extends Component
/** /**
* Set boundaryscannercountry option * Set boundaryscannercountry option
* *
* @param string $country * @param string $country
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setBoundaryScannerCountry($country) public function setBoundaryScannerCountry($country)
{ {
......
...@@ -373,16 +373,16 @@ class Spellcheck extends Component ...@@ -373,16 +373,16 @@ class Spellcheck extends Component
return $this->getOption('accuracy'); return $this->getOption('accuracy');
} }
/** /**
* Set a collation param * Set a collation param
* @param string $param * @param string $param
* @param mixed $value * @param mixed $value
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setCollateParam($param, $value) public function setCollateParam($param, $value)
{ {
$this->collateParams[$param] = $value; $this->collateParams[$param] = $value;
return $this; return $this;
} }
......
...@@ -52,13 +52,6 @@ class Field extends Configurable ...@@ -52,13 +52,6 @@ class Field extends Configurable
*/ */
protected $facets = array(); protected $facets = array();
/**
* Exclude tags for this stat
*
* @var array
*/
protected $excludes = array();
/** /**
* Initialize options * Initialize options
* *
...@@ -74,13 +67,6 @@ class Field extends Configurable ...@@ -74,13 +67,6 @@ class Field extends Configurable
case 'facet': case 'facet':
$this->setFacets($value); $this->setFacets($value);
break; break;
case 'exclude':
if (!is_array($value)) {
$value = array($value);
}
$this->setExcludes($value);
unset($this->options['exclude']);
break;
} }
} }
} }
...@@ -123,7 +109,7 @@ class Field extends Configurable ...@@ -123,7 +109,7 @@ class Field extends Configurable
* Specify multiple facets to return in the resultset * Specify multiple facets to return in the resultset
* *
* @param string|array $facets can be an array or string with comma * @param string|array $facets can be an array or string with comma
* separated facetnames * separated facetnames
* *
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
...@@ -193,83 +179,4 @@ class Field extends Configurable ...@@ -193,83 +179,4 @@ class Field extends Configurable
return $this; return $this;
} }
}
/**
* Add an exclude tag
*
* @param string $tag
* @return self Provides fluent interface
*/
public function addExclude($tag)
{
$this->excludes[$tag] = true;
return $this;
}
/**
* Add multiple exclude tags
*
* @param array $excludes
* @return self Provides fluent interface
*/
public function addExcludes(array $excludes)
{
foreach ($excludes as $exclude) {
$this->addExclude($exclude);
}
return $this;
}
/**
* Get all excludes
*
* @return array
*/
public function getExcludes()
{
return array_keys($this->excludes);
}
/**
* Remove a single exclude tag
*
* @param string $exclude
* @return self Provides fluent interface
*/
public function removeExclude($exclude)
{
if (isset($this->excludes[$exclude])) {
unset($this->excludes[$exclude]);
}
return $this;
}
/**
* Remove all excludes
*
* @return self Provides fluent interface
*/
public function clearExcludes()
{
$this->excludes = array();
return $this;
}
/**
* Set multiple excludes
*
* This overwrites any existing excludes
*
* @param array $excludes
*/
public function setExcludes($excludes)
{
$this->clearExcludes();
$this->addExcludes($excludes);
}
}
\ No newline at end of file
...@@ -288,7 +288,7 @@ class Stats extends Component ...@@ -288,7 +288,7 @@ class Stats extends Component
* Specify multiple facets to return in the resultset * Specify multiple facets to return in the resultset
* *
* @param string|array $facets can be an array or string with comma * @param string|array $facets can be an array or string with comma
* separated facetnames * separated facetnames
* *
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
......
...@@ -451,7 +451,7 @@ class Query extends BaseQuery ...@@ -451,7 +451,7 @@ class Query extends BaseQuery
* Specify multiple fields to return in the resultset * Specify multiple fields to return in the resultset
* *
* @param string|array $fields can be an array or string with comma * @param string|array $fields can be an array or string with comma
* separated fieldnames * separated fieldnames
* *
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
...@@ -851,8 +851,8 @@ class Query extends BaseQuery ...@@ -851,8 +851,8 @@ class Query extends BaseQuery
* *
* You can remove a component by passing its key or the component instance. * You can remove a component by passing its key or the component instance.
* *
* @param string|AbstractComponent $component * @param string|AbstractComponent $component
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function removeComponent($component) public function removeComponent($component)
{ {
......
...@@ -40,12 +40,11 @@ namespace Solarium\QueryType\Select\RequestBuilder\Component; ...@@ -40,12 +40,11 @@ namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent; use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent;
use Solarium\Core\Client\Request; use Solarium\Core\Client\Request;
use Solarium\Core\Query\RequestBuilder;
/** /**
* Add select component stats to the request * Add select component stats to the request
*/ */
class Stats extends RequestBuilder class Stats implements ComponentRequestBuilderInterface
{ {
/** /**
* Add request settings for the stats component * Add request settings for the stats component
...@@ -62,12 +61,7 @@ class Stats extends RequestBuilder ...@@ -62,12 +61,7 @@ class Stats extends RequestBuilder
// add fields // add fields
foreach ($component->getFields() as $field) { foreach ($component->getFields() as $field) {
$value = $this->renderLocalParams( $request->addParam('stats.field', $field->getKey());
$field->getKey(),
array('ex' => $field->getExcludes())
);
$request->addParam('stats.field', $value);
// add field specific facet stats // add field specific facet stats
foreach ($field->getFacets() as $facet) { foreach ($field->getFacets() as $facet) {
...@@ -82,4 +76,4 @@ class Stats extends RequestBuilder ...@@ -82,4 +76,4 @@ class Stats extends RequestBuilder
return $request; return $request;
} }
} }
\ No newline at end of file
...@@ -144,9 +144,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac ...@@ -144,9 +144,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/** /**
* Add a facet result for a field facet * Add a facet result for a field facet
* *
* @param Query $query * @param Query $query
* @param QueryFacetField $facet * @param QueryFacetField $facet
* @param array $data * @param array $data
* @return ResultFacetField|null * @return ResultFacetField|null
*/ */
protected function facetField($query, $facet, $data) protected function facetField($query, $facet, $data)
...@@ -168,8 +168,8 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac ...@@ -168,8 +168,8 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/** /**
* Add a facet result for a facet query * Add a facet result for a facet query
* *
* @param QueryFacetQuery $facet * @param QueryFacetQuery $facet
* @param array $data * @param array $data
* @return ResultFacetQuery|null * @return ResultFacetQuery|null
*/ */
protected function facetQuery($facet, $data) protected function facetQuery($facet, $data)
...@@ -185,8 +185,8 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac ...@@ -185,8 +185,8 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/** /**
* Add a facet result for a multiquery facet * Add a facet result for a multiquery facet
* *
* @param QueryFacetMultiQuery $facet * @param QueryFacetMultiQuery $facet
* @param array $data * @param array $data
* @return ResultFacetMultiQuery|null * @return ResultFacetMultiQuery|null
*/ */
protected function facetMultiQuery($facet, $data) protected function facetMultiQuery($facet, $data)
...@@ -210,9 +210,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac ...@@ -210,9 +210,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/** /**
* Add a facet result for a range facet * Add a facet result for a range facet
* *
* @param Query $query * @param Query $query
* @param QueryFacetRange $facet * @param QueryFacetRange $facet
* @param array $data * @param array $data
* @return ResultFacetRange|null * @return ResultFacetRange|null
*/ */
protected function facetRange($query, $facet, $data) protected function facetRange($query, $facet, $data)
...@@ -240,9 +240,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac ...@@ -240,9 +240,9 @@ class FacetSet extends ResponseParserAbstract implements ComponentParserInterfac
/** /**
* Add a facet result for a range facet * Add a facet result for a range facet
* *
* @param Query $query * @param Query $query
* @param QueryFacetPivot $facet * @param QueryFacetPivot $facet
* @param array $data * @param array $data
* @return ResultFacetPivot|null * @return ResultFacetPivot|null
*/ */
protected function facetPivot($query, $facet, $data) protected function facetPivot($query, $facet, $data)
......
...@@ -105,8 +105,8 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf ...@@ -105,8 +105,8 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
/** /**
* Parse collation data into a result object * Parse collation data into a result object
* *
* @param Query $queryObject * @param Query $queryObject
* @param array $values * @param array $values
* @return Collation[] * @return Collation[]
*/ */
protected function parseCollation($queryObject, $values) protected function parseCollation($queryObject, $values)
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
*/ */
namespace Solarium\QueryType\Select\Result\Highlighting; namespace Solarium\QueryType\Select\Result\Highlighting;
use Solarium\QueryType\Select\Result\Highlighting\Result;
/** /**
* Select component highlighting result * Select component highlighting result
*/ */
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
*/ */
namespace Solarium\QueryType\Select\Result\MoreLikeThis; namespace Solarium\QueryType\Select\Result\MoreLikeThis;
use Solarium\QueryType\Select\Result\MoreLikeThis\Result;
/** /**
* Select component morelikethis result * Select component morelikethis result
*/ */
......
...@@ -71,9 +71,9 @@ class Result implements \IteratorAggregate, \Countable ...@@ -71,9 +71,9 @@ class Result implements \IteratorAggregate, \Countable
/** /**
* Constructor * Constructor
* *
* @param int $numFound * @param int $numFound
* @param float|null $maxScore * @param float|null $maxScore
* @param array $documents * @param array $documents
*/ */
public function __construct($numFound, $maxScore, $documents) public function __construct($numFound, $maxScore, $documents)
{ {
......
...@@ -40,7 +40,6 @@ namespace Solarium\QueryType\Select\Result; ...@@ -40,7 +40,6 @@ namespace Solarium\QueryType\Select\Result;
use Solarium\QueryType\Select\Query\Query as SelectQuery; use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\Core\Query\Result\QueryType as BaseResult; use Solarium\Core\Query\Result\QueryType as BaseResult;
use Solarium\QueryType\Select\Result\DocumentInterface;
/** /**
* Select query result * Select query result
......
...@@ -38,9 +38,6 @@ ...@@ -38,9 +38,6 @@
*/ */
namespace Solarium\QueryType\Select\Result\Spellcheck; namespace Solarium\QueryType\Select\Result\Spellcheck;
use Solarium\QueryType\Select\Result\Spellcheck\Collation;
use Solarium\QueryType\Select\Result\Spellcheck\Suggestion;
/** /**
* Select component spellcheck result * Select component spellcheck result
*/ */
......
...@@ -46,11 +46,11 @@ class Suggestion ...@@ -46,11 +46,11 @@ class Suggestion
/** /**
* Constructor * Constructor
* *
* @param int $numFound * @param int $numFound
* @param int $startOffset * @param int $startOffset
* @param int $endOffset * @param int $endOffset
* @param int $originalFrequency * @param int $originalFrequency
* @param array $words * @param array $words
*/ */
public function __construct($numFound, $startOffset, $endOffset, $originalFrequency, $words) public function __construct($numFound, $startOffset, $endOffset, $originalFrequency, $words)
{ {
......
...@@ -38,8 +38,6 @@ ...@@ -38,8 +38,6 @@
*/ */
namespace Solarium\QueryType\Select\Result\Stats; namespace Solarium\QueryType\Select\Result\Stats;
use Solarium\QueryType\Select\Result\Stats\Result;
/** /**
* Select component stats result * Select component stats result
*/ */
......
...@@ -40,8 +40,6 @@ namespace Solarium\QueryType\Suggester; ...@@ -40,8 +40,6 @@ namespace Solarium\QueryType\Suggester;
use Solarium\Core\Query\Query as BaseQuery; use Solarium\Core\Query\Query as BaseQuery;
use Solarium\Core\Client\Client; use Solarium\Core\Client\Client;
use Solarium\QueryType\Suggester\RequestBuilder;
use Solarium\QueryType\Suggester\ResponseParser;
/** /**
* Suggester Query * Suggester Query
......
...@@ -50,7 +50,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -50,7 +50,7 @@ class RequestBuilder extends BaseRequestBuilder
/** /**
* Build request for a Suggester query * Build request for a Suggester query
* *
* @param QueryInterface|Query $query * @param QueryInterface|Query $query
* @return Request * @return Request
*/ */
public function build(QueryInterface $query) public function build(QueryInterface $query)
......
...@@ -40,8 +40,6 @@ namespace Solarium\QueryType\Terms; ...@@ -40,8 +40,6 @@ namespace Solarium\QueryType\Terms;
use Solarium\Core\Client\Client; use Solarium\Core\Client\Client;
use Solarium\Core\Query\Query as BaseQuery; use Solarium\Core\Query\Query as BaseQuery;
use Solarium\QueryType\Terms\RequestBuilder;
use Solarium\QueryType\Terms\ResponseParser;
/** /**
* Terms query * Terms query
......
...@@ -53,7 +53,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -53,7 +53,7 @@ class RequestBuilder extends BaseRequestBuilder
/** /**
* Build request for a Terms query * Build request for a Terms query
* *
* @param QueryInterface|Query $query * @param QueryInterface|Query $query
* @return Request * @return Request
*/ */
public function build(QueryInterface $query) public function build(QueryInterface $query)
......
...@@ -39,7 +39,6 @@ ...@@ -39,7 +39,6 @@
*/ */
namespace Solarium\QueryType\Terms; namespace Solarium\QueryType\Terms;
use Solarium\QueryType\Terms\Query;
use Solarium\Core\Query\ResponseParser as ResponseParserAbstract; use Solarium\Core\Query\ResponseParser as ResponseParserAbstract;
use Solarium\Core\Query\ResponseParserInterface as ResponseParserInterface; use Solarium\Core\Query\ResponseParserInterface as ResponseParserInterface;
......
...@@ -381,14 +381,15 @@ class Document extends AbstractDocument implements DocumentInterface ...@@ -381,14 +381,15 @@ class Document extends AbstractDocument implements DocumentInterface
if ($value !== null) { if ($value !== null) {
$this->addField($key, $value); $this->addField($key, $value);
} }
return $this; return $this;
} }
/** /**
* Sets the modifier type for the provided field * Sets the modifier type for the provided field
* *
* @param string $key * @param string $key
* @param string $modifier * @param string $modifier
* @throws RuntimeException * @throws RuntimeException
* @return self * @return self
*/ */
...@@ -398,13 +399,14 @@ class Document extends AbstractDocument implements DocumentInterface ...@@ -398,13 +399,14 @@ class Document extends AbstractDocument implements DocumentInterface
throw new RuntimeException('Attempt to set an atomic update modifier that is not supported'); throw new RuntimeException('Attempt to set an atomic update modifier that is not supported');
} }
$this->modifiers[$key] = $modifier; $this->modifiers[$key] = $modifier;
return $this; return $this;
} }
/** /**
* Returns the appropriate modifier for atomic updates. * Returns the appropriate modifier for atomic updates.
* *
* @param string $key * @param string $key
* @return null|string * @return null|string
*/ */
public function getFieldModifier($key) public function getFieldModifier($key)
...@@ -434,12 +436,13 @@ class Document extends AbstractDocument implements DocumentInterface ...@@ -434,12 +436,13 @@ class Document extends AbstractDocument implements DocumentInterface
/** /**
* Set version * Set version
* *
* @param int $version * @param int $version
* @return self * @return self
*/ */
public function setVersion($version) public function setVersion($version)
{ {
$this->version = $version; $this->version = $version;
return $this; return $this;
} }
......
...@@ -452,8 +452,8 @@ class Query extends BaseQuery ...@@ -452,8 +452,8 @@ class Query extends BaseQuery
* *
* This class should implement the document interface * This class should implement the document interface
* *
* @param string $value classname * @param string $value classname
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setDocumentClass($value) public function setDocumentClass($value)
{ {
...@@ -480,14 +480,15 @@ class Query extends BaseQuery ...@@ -480,14 +480,15 @@ class Query extends BaseQuery
* *
* @since 2.1.0 * @since 2.1.0
* *
* @param array $fields * @param array $fields
* @param array $boosts * @param array $boosts
* @param array $modifiers * @param array $modifiers
* @return DocumentInterface * @return DocumentInterface
*/ */
public function createDocument($fields = array(), $boosts = array(), $modifiers = array()) public function createDocument($fields = array(), $boosts = array(), $modifiers = array())
{ {
$class = $this->getDocumentClass(); $class = $this->getDocumentClass();
return new $class($fields, $boosts, $modifiers); return new $class($fields, $boosts, $modifiers);
} }
} }
...@@ -108,7 +108,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -108,7 +108,7 @@ class RequestBuilder extends BaseRequestBuilder
* Build XML for an add command * Build XML for an add command
* *
* @param \Solarium\QueryType\Update\Query\Command\Add $command * @param \Solarium\QueryType\Update\Query\Command\Add $command
* @param UpdateQuery $query * @param UpdateQuery $query
* @return string * @return string
*/ */
public function buildAddXml($command, $query = null) public function buildAddXml($command, $query = null)
...@@ -153,10 +153,10 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -153,10 +153,10 @@ class RequestBuilder extends BaseRequestBuilder
* *
* Used in the add command * Used in the add command
* *
* @param string $name * @param string $name
* @param float $boost * @param float $boost
* @param mixed $value * @param mixed $value
* @param string $modifier * @param string $modifier
* @param UpdateQuery $query * @param UpdateQuery $query
* @return string * @return string
*/ */
......
...@@ -107,37 +107,4 @@ class FieldTest extends \PHPUnit_Framework_TestCase ...@@ -107,37 +107,4 @@ class FieldTest extends \PHPUnit_Framework_TestCase
$this->field->setFacets(array('facet3', 'facet4')); $this->field->setFacets(array('facet3', 'facet4'));
$this->assertEquals(array('facet3', 'facet4'), $this->field->getFacets()); $this->assertEquals(array('facet3', 'facet4'), $this->field->getFacets());
} }
public function testAddExclude()
{
$this->field->addExclude('e1');
$this->assertEquals(array('e1'), $this->field->getExcludes());
}
public function testAddExcludes()
{
$this->field->addExcludes(array('e1', 'e2'));
$this->assertEquals(array('e1', 'e2'), $this->field->getExcludes());
}
public function testRemoveExclude()
{
$this->field->addExcludes(array('e1', 'e2'));
$this->field->removeExclude('e1');
$this->assertEquals(array('e2'), $this->field->getExcludes());
}
public function testClearExcludes()
{
$this->field->addExcludes(array('e1', 'e2'));
$this->field->clearExcludes();
$this->assertEquals(array(), $this->field->getExcludes());
}
public function testSetExcludes()
{
$this->field->addExcludes(array('e1', 'e2'));
$this->field->setExcludes(array('e3', 'e4'));
$this->assertEquals(array('e3', 'e4'), $this->field->getExcludes());
}
} }
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