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

Lots of fixes in namespaces and phpdoc

parent 3f72e644
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
* @namespace * @namespace
*/ */
namespace Solarium\Client\Adapter; namespace Solarium\Client\Adapter;
use Solarium; use Solarium\Exception;
use Solarium\Client; use Solarium\Client\HttpException;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\Client\Response; use Solarium\Client\Response;
...@@ -64,7 +64,7 @@ class Curl extends Adapter ...@@ -64,7 +64,7 @@ class Curl extends Adapter
{ {
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
if (!function_exists('curl_init')) { if (!function_exists('curl_init')) {
throw new Solarium\Exception('cURL is not available, install it to use the CurlHttp adapter'); throw new Exception('cURL is not available, install it to use the CurlHttp adapter');
} }
parent::_init(); parent::_init();
...@@ -167,7 +167,7 @@ class Curl extends Adapter ...@@ -167,7 +167,7 @@ class Curl extends Adapter
$httpResponse = curl_exec($handler); $httpResponse = curl_exec($handler);
} else { } else {
throw new Solarium\Exception("unsupported method: $method"); throw new Exception("unsupported method: $method");
} }
return $handler; return $handler;
...@@ -199,7 +199,7 @@ class Curl extends Adapter ...@@ -199,7 +199,7 @@ class Curl extends Adapter
/** /**
* Check result of a request * Check result of a request
* *
* @throws Client\HttpException * @throws HttpException
* @param string $data * @param string $data
* @param array $headers * @param array $headers
* @return void * @return void
...@@ -209,7 +209,7 @@ class Curl extends Adapter ...@@ -209,7 +209,7 @@ class Curl extends Adapter
// if there is no data and there are no headers it's a total failure, // if there is no data and there are no headers it's a total failure,
// a connection to the host was impossible. // a connection to the host was impossible.
if (empty($data) && count($headers) == 0) { if (empty($data) && count($headers) == 0) {
throw new Client\HttpException("HTTP request failed"); throw new HttpException("HTTP request failed");
} }
} }
} }
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
* @namespace * @namespace
*/ */
namespace Solarium\Client\Adapter; namespace Solarium\Client\Adapter;
use Solarium; use Solarium\Exception;
use Solarium\Client; use Solarium\Client\HttpException;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\Client\Response; use Solarium\Client\Response;
...@@ -57,7 +57,7 @@ class Http extends Adapter ...@@ -57,7 +57,7 @@ class Http extends Adapter
/** /**
* Handle Solr communication * Handle Solr communication
* *
* @throws Solarium\Exception * @throws Exception
* @param Request $request * @param Request $request
* @return Response * @return Response
*/ */
...@@ -76,7 +76,7 @@ class Http extends Adapter ...@@ -76,7 +76,7 @@ class Http extends Adapter
/** /**
* Check result of a request * Check result of a request
* *
* @throws Client\HttpException * @throws HttpException
* @param string $data * @param string $data
* @param array $headers * @param array $headers
* @return void * @return void
...@@ -86,7 +86,7 @@ class Http extends Adapter ...@@ -86,7 +86,7 @@ class Http extends Adapter
// if there is no data and there are no headers it's a total failure, // if there is no data and there are no headers it's a total failure,
// a connection to the host was impossible. // a connection to the host was impossible.
if (false === $data && count($headers) == 0) { if (false === $data && count($headers) == 0) {
throw new Client\HttpException("HTTP request failed"); throw new HttpException("HTTP request failed");
} }
} }
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
* @namespace * @namespace
*/ */
namespace Solarium\Client\Adapter; namespace Solarium\Client\Adapter;
use Solarium; use Solarium\Exception;
use Solarium\Client; use Solarium\Client\HttpException;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\Client\Response; use Solarium\Client\Response;
...@@ -65,7 +65,7 @@ class PeclHttp extends Adapter ...@@ -65,7 +65,7 @@ class PeclHttp extends Adapter
{ {
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
if (!class_exists('HttpRequest', false)) { if (!class_exists('HttpRequest', false)) {
throw new Solarium\Exception('Pecl_http is not available, install it to use the PeclHttp adapter'); throw new Exception('Pecl_http is not available, install it to use the PeclHttp adapter');
} }
parent::_init(); parent::_init();
...@@ -85,7 +85,7 @@ class PeclHttp extends Adapter ...@@ -85,7 +85,7 @@ class PeclHttp extends Adapter
try { try {
$httpMessage = $httpRequest->send(); $httpMessage = $httpRequest->send();
} catch (\Exception $e) { } catch (\Exception $e) {
throw new Client\HttpException($e->getMessage()); throw new HttpException($e->getMessage());
} }
return new Response( return new Response(
...@@ -107,7 +107,7 @@ class PeclHttp extends Adapter ...@@ -107,7 +107,7 @@ class PeclHttp extends Adapter
* $headers[0] = 'Content-Type: text/plain'; * $headers[0] = 'Content-Type: text/plain';
* </code> * </code>
* *
* @param $message HttpMessage * @param $message \HttpMessage
* @return array * @return array
*/ */
protected function _toRawHeaders($message) protected function _toRawHeaders($message)
...@@ -161,7 +161,7 @@ class PeclHttp extends Adapter ...@@ -161,7 +161,7 @@ class PeclHttp extends Adapter
$method = HTTP_METH_HEAD; $method = HTTP_METH_HEAD;
break; break;
default: default:
throw new Solarium\Exception( throw new Exception(
'Unsupported method: ' . $request->getMethod() 'Unsupported method: ' . $request->getMethod()
); );
} }
......
...@@ -63,7 +63,7 @@ class ZendHttp extends Adapter ...@@ -63,7 +63,7 @@ class ZendHttp extends Adapter
/** /**
* Zend Http instance for communication with Solr * Zend Http instance for communication with Solr
* *
* @var Zend_Http_Client * @var \Zend_Http_Client
*/ */
protected $_zendHttp; protected $_zendHttp;
...@@ -111,7 +111,7 @@ class ZendHttp extends Adapter ...@@ -111,7 +111,7 @@ class ZendHttp extends Adapter
* upon first use, using default and/or custom options (the most common use * upon first use, using default and/or custom options (the most common use
* case) * case)
* *
* @param Zend_Http_Client $zendHttp * @param \Zend_Http_Client $zendHttp
* @return self Provides fluent interface * @return self Provides fluent interface
*/ */
public function setZendHttp($zendHttp) public function setZendHttp($zendHttp)
...@@ -130,7 +130,7 @@ class ZendHttp extends Adapter ...@@ -130,7 +130,7 @@ class ZendHttp extends Adapter
* options, get the last response and use many other features offered by the * options, get the last response and use many other features offered by the
* Zend_Http_Client API. * Zend_Http_Client API.
* *
* @return Zend_Http_Client * @return \Zend_Http_Client
*/ */
public function getZendHttp() public function getZendHttp()
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Client; namespace Solarium\Client;
use Solarium; use Solarium\Exception;
use Solarium\Configurable; use Solarium\Configurable;
use Solarium\Plugin\AbstractPlugin; use Solarium\Plugin\AbstractPlugin;
use Solarium\Query\Query; use Solarium\Query\Query;
...@@ -368,8 +368,8 @@ class Client extends Configurable ...@@ -368,8 +368,8 @@ class Client extends Configurable
$plugin = new $plugin; $plugin = new $plugin;
} }
if (!($plugin instanceof Solarium\Plugin\AbstractPlugin)) { if (!($plugin instanceof \Solarium\Plugin\AbstractPlugin)) {
throw new Solarium\Exception('All plugins must extend Solarium\PluginAbstractPlugin'); throw new Exception('All plugins must extend Solarium\Plugin\AbstractPlugin');
} }
$plugin->init($this, $options); $plugin->init($this, $options);
...@@ -427,7 +427,7 @@ class Client extends Configurable ...@@ -427,7 +427,7 @@ class Client extends Configurable
$this->registerPlugin($key, $this->_pluginTypes[$key]); $this->registerPlugin($key, $this->_pluginTypes[$key]);
return $this->_pluginInstances[$key]; return $this->_pluginInstances[$key];
} else { } else {
throw new Solarium\Exception('Cannot autoload plugin of unknown type: ' . $key); throw new Exception('Cannot autoload plugin of unknown type: ' . $key);
} }
} else { } else {
return null; return null;
...@@ -516,7 +516,7 @@ class Client extends Configurable ...@@ -516,7 +516,7 @@ class Client extends Configurable
$queryType = $query->getType(); $queryType = $query->getType();
if (!isset($this->_queryTypes[$queryType])) { if (!isset($this->_queryTypes[$queryType])) {
throw new Solarium\Exception('No requestbuilder registered for querytype: '. $queryType); throw new Exception('No requestbuilder registered for querytype: '. $queryType);
} }
$requestBuilder = $this->_queryTypes[$queryType]['requestbuilder']; $requestBuilder = $this->_queryTypes[$queryType]['requestbuilder'];
...@@ -743,7 +743,7 @@ class Client extends Configurable ...@@ -743,7 +743,7 @@ class Client extends Configurable
if($pluginResult !== null) return $pluginResult; if($pluginResult !== null) return $pluginResult;
if (!isset($this->_queryTypes[$type])) { if (!isset($this->_queryTypes[$type])) {
throw new Solarium\Exception('Unknown querytype: '. $type); throw new Exception('Unknown querytype: '. $type);
} }
$class = $this->_queryTypes[$type]['query']; $class = $this->_queryTypes[$type]['query'];
......
...@@ -69,7 +69,7 @@ class Configurable ...@@ -69,7 +69,7 @@ class Configurable
* After handling the options the {@link _init()} method is called. * After handling the options the {@link _init()} method is called.
* *
* @throws Exception * @throws Exception
* @param array|Zend_Config $options * @param array|\Zend_Config $options
* @return void * @return void
*/ */
public function __construct($options = null) public function __construct($options = null)
...@@ -89,7 +89,7 @@ class Configurable ...@@ -89,7 +89,7 @@ class Configurable
* Zend Framework, but can also easily be implemented in any other object. * Zend Framework, but can also easily be implemented in any other object.
* *
* @throws Exception * @throws Exception
* @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)
* *
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Document; namespace Solarium\Document;
use Solarium; use Solarium\Exception;
/** /**
* Read-only Solr document * Read-only Solr document
...@@ -113,7 +113,7 @@ class ReadOnly implements \IteratorAggregate, \Countable, \ArrayAccess ...@@ -113,7 +113,7 @@ class ReadOnly implements \IteratorAggregate, \Countable, \ArrayAccess
*/ */
public function __set($name, $value) public function __set($name, $value)
{ {
throw new Solarium\Exception('A readonly document cannot be altered'); throw new Exception('A readonly document cannot be altered');
} }
/** /**
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
namespace Solarium\Plugin; namespace Solarium\Plugin;
use Solarium\Client; use Solarium\Client;
use Solarium\QueryType\Update\Result as UpdateResult; use Solarium\QueryType\Update\Result as UpdateResult;
use Solarium\QueryType\Update\Query as UpdateQuery; use Solarium\QueryType\Update\Query\Query as UpdateQuery;
use Solarium\Document\ReadOnly as ReadOnlyDocument; use Solarium\Document\ReadOnly as ReadOnlyDocument;
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Plugin\CustomizeRequest; namespace Solarium\Plugin\CustomizeRequest;
use Solarium; use Solarium\Exception;
use Solarium\Plugin\AbstractPlugin; use Solarium\Plugin\AbstractPlugin;
use Solarium\Query\Query; use Solarium\Query\Query;
use Solarium\Client\Request; use Solarium\Client\Request;
...@@ -128,14 +128,14 @@ class CustomizeRequest extends AbstractPlugin ...@@ -128,14 +128,14 @@ class CustomizeRequest extends AbstractPlugin
// check for non-empty key // check for non-empty key
if (0 === strlen($key)) { if (0 === strlen($key)) {
throw new Solarium\Exception('A Customization must have a key value'); throw new Exception('A Customization must have a key value');
} }
// check for a unique key // check for a unique key
if (array_key_exists($key, $this->_customizations)) { if (array_key_exists($key, $this->_customizations)) {
//double add calls for the same customization are ignored, others cause an exception //double add calls for the same customization are ignored, others cause an exception
if ($this->_customizations[$key] !== $customization) { if ($this->_customizations[$key] !== $customization) {
throw new Solarium\Exception('A Customization must have a unique key value'); throw new Exception('A Customization must have a unique key value');
} }
} }
...@@ -248,7 +248,7 @@ class CustomizeRequest extends AbstractPlugin ...@@ -248,7 +248,7 @@ class CustomizeRequest extends AbstractPlugin
// first validate // first validate
if (!$customization->isValid()) { if (!$customization->isValid()) {
throw new Solarium\Exception('Request customization with key "' . $key . '" is invalid'); throw new Exception('Request customization with key "' . $key . '" is invalid');
} }
// apply to request, depending on type // apply to request, depending on type
......
...@@ -40,7 +40,8 @@ ...@@ -40,7 +40,8 @@
* @namespace * @namespace
*/ */
namespace Solarium\Plugin\Loadbalancer; namespace Solarium\Plugin\Loadbalancer;
use Solarium; use Solarium\Plugin\AbstractPlugin;
use Solarium\Exception;
use Solarium\Client\Client; use Solarium\Client\Client;
use Solarium\Client\HttpException; use Solarium\Client\HttpException;
use Solarium\Query\Query; use Solarium\Query\Query;
...@@ -63,7 +64,7 @@ use Solarium\Client\Response; ...@@ -63,7 +64,7 @@ use Solarium\Client\Response;
* @package Solarium * @package Solarium
* @subpackage Plugin * @subpackage Plugin
*/ */
class Loadbalancer extends Solarium\Plugin\AbstractPlugin class Loadbalancer extends AbstractPlugin
{ {
/** /**
...@@ -214,7 +215,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin ...@@ -214,7 +215,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
public function addServer($key, $options, $weight = 1) public function addServer($key, $options, $weight = 1)
{ {
if (array_key_exists($key, $this->_servers)) { if (array_key_exists($key, $this->_servers)) {
throw new Solarium\Exception('A server for the loadbalancer plugin must have a unique key'); throw new Exception('A server for the loadbalancer plugin must have a unique key');
} else { } else {
$this->_servers[$key] = array( $this->_servers[$key] = array(
'options' => $options, 'options' => $options,
...@@ -247,7 +248,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin ...@@ -247,7 +248,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
public function getServer($key) public function getServer($key)
{ {
if (!isset($this->_servers[$key])) { if (!isset($this->_servers[$key])) {
throw new Solarium\Exception('Unknown server key'); throw new Exception('Unknown server key');
} }
return $this->_servers[$key]; return $this->_servers[$key];
...@@ -321,7 +322,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin ...@@ -321,7 +322,7 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
public function setForcedServerForNextQuery($key) public function setForcedServerForNextQuery($key)
{ {
if ($key !== null && !array_key_exists($key, $this->_servers)) { if ($key !== null && !array_key_exists($key, $this->_servers)) {
throw new Solarium\Exception('Unknown server forced for next query'); throw new Exception('Unknown server forced for next query');
} }
$this->_nextServer = $key; $this->_nextServer = $key;
...@@ -496,13 +497,13 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin ...@@ -496,13 +497,13 @@ class Loadbalancer extends Solarium\Plugin\AbstractPlugin
} catch(HttpException $e) { } catch(HttpException $e) {
// ignore HTTP errors and try again // ignore HTTP errors and try again
// but do issue an event for things like logging // but do issue an event for things like logging
$e = new Solarium\Exception('Maximum number of loadbalancer retries reached'); $e = new Exception('Maximum number of loadbalancer retries reached');
$this->_client->triggerEvent('LoadbalancerServerFail', array($options, $e)); $this->_client->triggerEvent('LoadbalancerServerFail', array($options, $e));
} }
} }
// if we get here no more retries available, throw exception // if we get here no more retries available, throw exception
$e = new Solarium\Exception('Maximum number of loadbalancer retries reached'); $e = new Exception('Maximum number of loadbalancer retries reached');
throw $e; throw $e;
} else { } else {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Plugin\Loadbalancer; namespace Solarium\Plugin\Loadbalancer;
use Solarium; use Solarium\Exception;
/** /**
* Weighted random choice class * Weighted random choice class
...@@ -83,7 +83,7 @@ class WeightedRandomChoice ...@@ -83,7 +83,7 @@ class WeightedRandomChoice
{ {
$i = 0; $i = 0;
foreach ($choices AS $key => $weight) { foreach ($choices AS $key => $weight) {
if ($weight <=0) throw new Solarium\Exception('Weight must be greater than zero'); if ($weight <=0) throw new Exception('Weight must be greater than zero');
$this->_totalWeight += $weight; $this->_totalWeight += $weight;
$this->_lookup[$i] = $this->_totalWeight; $this->_lookup[$i] = $this->_totalWeight;
...@@ -102,7 +102,7 @@ class WeightedRandomChoice ...@@ -102,7 +102,7 @@ class WeightedRandomChoice
public function getRandom($excludes = array()) public function getRandom($excludes = array())
{ {
if (count($excludes) == count($this->_values)) { if (count($excludes) == count($this->_values)) {
throw new Solarium\Exception('No more server entries available'); throw new Exception('No more server entries available');
} }
// continue until a non-excluded value is found // continue until a non-excluded value is found
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
*/ */
namespace Solarium\Query; namespace Solarium\Query;
use Solarium\Query\Query; use Solarium\Query\Query;
use Solarium; use Solarium\Exception;
/** /**
* Query helper * Query helper
...@@ -303,7 +303,7 @@ class Helper ...@@ -303,7 +303,7 @@ class Helper
if ($dereferenced) { if ($dereferenced) {
if (!$this->_query) { if (!$this->_query) {
throw new Solarium\Exception( throw new Exception(
'Dereferenced params can only be used in a Solarium_Query_Helper instance retrieved from the query ' 'Dereferenced params can only be used in a Solarium_Query_Helper instance retrieved from the query '
. 'by using the getHelper() method, this instance was manually created' . 'by using the getHelper() method, this instance was manually created'
); );
...@@ -375,7 +375,7 @@ class Helper ...@@ -375,7 +375,7 @@ class Helper
/** /**
* Render placeholders in a querystring * Render placeholders in a querystring
* *
* @throws Solarium\Exception * @throws Exception
* @param array $matches * @param array $matches
* @return string * @return string
*/ */
...@@ -387,7 +387,7 @@ class Helper ...@@ -387,7 +387,7 @@ class Helper
if (isset($this->_assembleParts[$partNumber-1])) { if (isset($this->_assembleParts[$partNumber-1])) {
$value = $this->_assembleParts[$partNumber-1]; $value = $this->_assembleParts[$partNumber-1];
} else { } else {
throw new Solarium\Exception('No value supplied for part #' . $partNumber . ' in query assembler'); throw new Exception('No value supplied for part #' . $partNumber . ' in query assembler');
} }
switch($partMode) switch($partMode)
......
...@@ -46,7 +46,7 @@ use Solarium\Client\Client; ...@@ -46,7 +46,7 @@ use Solarium\Client\Client;
* Analysis document query * Analysis document query
* *
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage QueryType
*/ */
class Field extends Query class Field extends Query
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Build a document analysis request * Build a document analysis request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Document extends BaseRequestBuilder class Document extends BaseRequestBuilder
{ {
......
...@@ -49,7 +49,7 @@ use Solarium\QueryType\Analysis\Query\Query; ...@@ -49,7 +49,7 @@ use Solarium\QueryType\Analysis\Query\Query;
* Build an analysis request * Build an analysis request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
......
...@@ -46,7 +46,7 @@ use Solarium\QueryType\Analysis\Result as AnalysisResult; ...@@ -46,7 +46,7 @@ use Solarium\QueryType\Analysis\Result as AnalysisResult;
* Parse document analysis response data * Parse document analysis response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Document extends Field class Document extends Field
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser; ...@@ -48,7 +48,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser;
* Parse document analysis response data * Parse document analysis response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Field extends BaseResponseParser class Field extends BaseResponseParser
{ {
......
...@@ -45,7 +45,7 @@ namespace Solarium\QueryType\Analysis\Result; ...@@ -45,7 +45,7 @@ namespace Solarium\QueryType\Analysis\Result;
* Analysis types result * Analysis types result
* *
* @package Solarium * @package Solarium
* @subpackage Result * @subpackage QueryType
*/ */
class Types extends ResultList class Types extends ResultList
{ {
......
...@@ -50,7 +50,7 @@ use Solarium\QueryType\Select\RequestBuilder\RequestBuilder as SelectRequestBuil ...@@ -50,7 +50,7 @@ use Solarium\QueryType\Select\RequestBuilder\RequestBuilder as SelectRequestBuil
* Build a MoreLikeThis request * Build a MoreLikeThis request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends SelectRequestBuilder class RequestBuilder extends SelectRequestBuilder
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\QueryType\Select\ResponseParser\ResponseParser as SelectResponsePar ...@@ -47,7 +47,7 @@ use Solarium\QueryType\Select\ResponseParser\ResponseParser as SelectResponsePar
* Parse MoreLikeThis response data * Parse MoreLikeThis response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class ResponseParser extends SelectResponseParser class ResponseParser extends SelectResponseParser
{ {
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\MoreLikeThis; namespace Solarium\QueryType\MoreLikeThis;
use Solarium; use Solarium\Exception;
use Solarium\Document; use Solarium\Document\ReadOnly as ReadOnlyDocument;
use Solarium\QueryType\Select\Result\Result as SelectResult; use Solarium\QueryType\Select\Result\Result as SelectResult;
/** /**
...@@ -91,7 +91,7 @@ class Result extends SelectResult ...@@ -91,7 +91,7 @@ class Result extends SelectResult
{ {
$query = $this->getQuery(); $query = $this->getQuery();
if ('none' == $query->getInterestingTerms()) { if ('none' == $query->getInterestingTerms()) {
throw new Solarium\Exception('interestingterms is none'); throw new Exception('interestingterms is none');
} }
$this->_parseResponse(); $this->_parseResponse();
return $this->_interestingTerms; return $this->_interestingTerms;
...@@ -103,13 +103,13 @@ class Result extends SelectResult ...@@ -103,13 +103,13 @@ class Result extends SelectResult
* Only available if matchinclude was set to true in the query. * Only available if matchinclude was set to true in the query.
* *
* @throws Solarium\Exception * @throws Solarium\Exception
* @return Document\ReadOnly * @return ReadOnlyDocument
*/ */
public function getMatch() public function getMatch()
{ {
$query = $this->getQuery(); $query = $this->getQuery();
if (true != $query->getMatchInclude()) { if (true != $query->getMatchInclude()) {
throw new Solarium\Exception('matchinclude was disabled in the MLT query'); throw new Exception('matchinclude was disabled in the MLT query');
} }
$this->_parseResponse(); $this->_parseResponse();
return $this->_match; return $this->_match;
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Ping; namespace Solarium\QueryType\Ping;
use Solarium\Client\Client;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\Client\RequestBuilder as BaseRequestBuilder; use Solarium\Client\RequestBuilder as BaseRequestBuilder;
...@@ -48,7 +47,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder; ...@@ -48,7 +47,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder;
* Build a ping request * Build a ping request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component; namespace Solarium\QueryType\Select\Query\Component;
use Solarium; use Solarium\Configurable;
/** /**
* Query component base class * Query component base class
...@@ -48,7 +48,7 @@ use Solarium; ...@@ -48,7 +48,7 @@ use Solarium;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
class Component extends Solarium\Configurable class Component extends Configurable
{ {
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Facet; namespace Solarium\QueryType\Select\Query\Component\Facet;
use Solarium; use Solarium\Configurable;
/** /**
* Facet base class * Facet base class
...@@ -50,7 +50,7 @@ use Solarium; ...@@ -50,7 +50,7 @@ use Solarium;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
abstract class Facet extends Solarium\Configurable abstract class Facet extends Configurable
{ {
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Facet; namespace Solarium\QueryType\Select\Query\Component\Facet;
use Solarium; use Solarium\Exception;
use Solarium\QueryType\Select\Query\Component\FacetSet; use Solarium\QueryType\Select\Query\Component\FacetSet;
/** /**
...@@ -136,11 +136,11 @@ class MultiQuery extends Facet ...@@ -136,11 +136,11 @@ class MultiQuery extends Facet
$key = $facetQuery->getKey(); $key = $facetQuery->getKey();
if (0 === strlen($key)) { if (0 === strlen($key)) {
throw new Solarium\Exception('A facetquery must have a key value'); throw new Exception('A facetquery must have a key value');
} }
if (array_key_exists($key, $this->_facetQueries)) { if (array_key_exists($key, $this->_facetQueries)) {
throw new Solarium\Exception('A query must have a unique key value within a multiquery facet'); throw new Exception('A query must have a unique key value within a multiquery facet');
} }
// forward shared excludes // forward shared excludes
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component; namespace Solarium\QueryType\Select\Query\Component;
use Solarium; use Solarium\Exception;
use Solarium\QueryType\Select\Query\Query as SelectQuery; use Solarium\QueryType\Select\Query\Query as SelectQuery;
/** /**
...@@ -270,13 +270,13 @@ class FacetSet extends Component ...@@ -270,13 +270,13 @@ class FacetSet extends Component
$key = $facet->getKey(); $key = $facet->getKey();
if (0 === strlen($key)) { if (0 === strlen($key)) {
throw new Solarium\Exception('A facet must have a key value'); throw new Exception('A facet must have a key value');
} }
//double add calls for the same facet are ignored, but non-unique keys cause an exception //double add calls for the same facet are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls? //@todo add trigger_error with a notice for double add calls?
if (array_key_exists($key, $this->_facets) && $this->_facets[$key] !== $facet) { if (array_key_exists($key, $this->_facets) && $this->_facets[$key] !== $facet) {
throw new Solarium\Exception('A facet must have a unique key value within a query'); throw new Exception('A facet must have a unique key value within a query');
} else { } else {
$this->_facets[$key] = $facet; $this->_facets[$key] = $facet;
} }
...@@ -395,7 +395,7 @@ class FacetSet extends Component ...@@ -395,7 +395,7 @@ class FacetSet extends Component
$type = strtolower($type); $type = strtolower($type);
if (!isset($this->_facetTypes[$type])) { if (!isset($this->_facetTypes[$type])) {
throw new Solarium\Exception("Facettype unknown: " . $type); throw new Exception("Facettype unknown: " . $type);
} }
$class = $this->_facetTypes[$type]; $class = $this->_facetTypes[$type];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Highlighting; namespace Solarium\QueryType\Select\Query\Component\Highlighting;
use Solarium; use Solarium\Configurable;
/** /**
* Highlighting per-field settings * Highlighting per-field settings
...@@ -50,7 +50,7 @@ use Solarium; ...@@ -50,7 +50,7 @@ use Solarium;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
class Field extends Solarium\Configurable class Field extends Configurable
{ {
/** /**
* Value for fragmenter option gap * Value for fragmenter option gap
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Highlighting; namespace Solarium\QueryType\Select\Query\Component\Highlighting;
use Solarium; use Solarium\Exception;
use Solarium\QueryType\Select\Query\Query as SelectQuery; use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\Query\Component\Component; use Solarium\QueryType\Select\Query\Component\Component;
...@@ -132,7 +132,7 @@ class Highlighting extends Component ...@@ -132,7 +132,7 @@ class Highlighting extends Component
// validate field // validate field
if ($field->getName() === null) { if ($field->getName() === null) {
throw new Solarium\Exception('To add a highlighting field it needs to have at least a "name" setting'); throw new Exception('To add a highlighting field it needs to have at least a "name" setting');
} }
$this->_fields[$field->getName()] = $field; $this->_fields[$field->getName()] = $field;
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Stats; namespace Solarium\QueryType\Select\Query\Component\Stats;
use Solarium; use Solarium\Configurable;
/** /**
* Stats component field class * Stats component field class
...@@ -49,7 +49,7 @@ use Solarium; ...@@ -49,7 +49,7 @@ use Solarium;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
class Field extends Solarium\Configurable class Field extends Configurable
{ {
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query\Component\Stats; namespace Solarium\QueryType\Select\Query\Component\Stats;
use Solarium; use Solarium\Exception;
use Solarium\QueryType\Select\Query\Query as SelectQuery; use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\Query\Component\Component; use Solarium\QueryType\Select\Query\Component\Component;
...@@ -145,13 +145,13 @@ class Stats extends Component ...@@ -145,13 +145,13 @@ class Stats extends Component
$key = $field->getKey(); $key = $field->getKey();
if (0 === strlen($key)) { if (0 === strlen($key)) {
throw new Solarium\Exception('A field must have a key value'); throw new Exception('A field must have a key value');
} }
//double add calls for the same field are ignored, but non-unique keys cause an exception //double add calls for the same field are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls? //@todo add trigger_error with a notice for double add calls?
if (array_key_exists($key, $this->_fields) && $this->_fields[$key] !== $field) { if (array_key_exists($key, $this->_fields) && $this->_fields[$key] !== $field) {
throw new Solarium\Exception('A field must have a unique key value'); throw new Exception('A field must have a unique key value');
} else { } else {
$this->_fields[$key] = $field; $this->_fields[$key] = $field;
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query; namespace Solarium\QueryType\Select\Query;
use Solarium; use Solarium\Configurable;
use Solarium\Query\Helper; use Solarium\Query\Helper;
/** /**
...@@ -51,7 +51,7 @@ use Solarium\Query\Helper; ...@@ -51,7 +51,7 @@ use Solarium\Query\Helper;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
class FilterQuery extends Solarium\Configurable class FilterQuery extends Configurable
{ {
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\Query; namespace Solarium\QueryType\Select\Query;
use Solarium; use Solarium\Exception;
use Solarium\Client\Client; use Solarium\Client\Client;
use Solarium\Query\Query as BaseQuery; use Solarium\Query\Query as BaseQuery;
...@@ -642,13 +642,13 @@ class Query extends BaseQuery ...@@ -642,13 +642,13 @@ class Query extends BaseQuery
$key = $filterQuery->getKey(); $key = $filterQuery->getKey();
if (0 === strlen($key)) { if (0 === strlen($key)) {
throw new Solarium\Exception('A filterquery must have a key value'); throw new Exception('A filterquery must have a key value');
} }
//double add calls for the same FQ are ignored, but non-unique keys cause an exception //double add calls for the same FQ are ignored, but non-unique keys cause an exception
//@todo add trigger_error with a notice for double add calls? //@todo add trigger_error with a notice for double add calls?
if (array_key_exists($key, $this->_filterQueries) && $this->_filterQueries[$key] !== $filterQuery) { if (array_key_exists($key, $this->_filterQueries) && $this->_filterQueries[$key] !== $filterQuery) {
throw new Solarium\Exception('A filterquery must have a unique key value within a query'); throw new Exception('A filterquery must have a unique key value within a query');
} else { } else {
$this->_filterQueries[$key] = $filterQuery; $this->_filterQueries[$key] = $filterQuery;
} }
...@@ -806,7 +806,7 @@ class Query extends BaseQuery ...@@ -806,7 +806,7 @@ class Query extends BaseQuery
if ($autoload == true) { if ($autoload == true) {
if (!isset($this->_componentTypes[$key])) { if (!isset($this->_componentTypes[$key])) {
throw new Solarium\Exception('Cannot autoload unknown component: ' . $key); throw new Exception('Cannot autoload unknown component: ' . $key);
} }
$className = $this->_componentTypes[$key]['component']; $className = $this->_componentTypes[$key]['component'];
...@@ -914,7 +914,7 @@ class Query extends BaseQuery ...@@ -914,7 +914,7 @@ class Query extends BaseQuery
* *
* This is a convenience method that maps presets to getComponent * This is a convenience method that maps presets to getComponent
* *
* @return Component\Highlighting * @return Component\Highlighting\Highlighting
*/ */
public function getHighlighting() public function getHighlighting()
{ {
...@@ -962,7 +962,7 @@ class Query extends BaseQuery ...@@ -962,7 +962,7 @@ class Query extends BaseQuery
* *
* This is a convenience method that maps presets to getComponent * This is a convenience method that maps presets to getComponent
* *
* @return Component\Stats * @return Component\Stats\Stats
*/ */
public function getStats() public function getStats()
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component debug to the request * Add select component debug to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Debug class Debug
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component dismax to the request * Add select component dismax to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class DisMax class DisMax
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component distributedsearch to the request * Add select component distributedsearch to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class DistributedSearch class DistributedSearch
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\RequestBuilder\Component; namespace Solarium\QueryType\Select\RequestBuilder\Component;
use Solarium; use Solarium\Exception;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\QueryType\Select\RequestBuilder\RequestBuilder; use Solarium\QueryType\Select\RequestBuilder\RequestBuilder;
use Solarium\QueryType\Select\Query\Component\FacetSet as FacetsetComponent; use Solarium\QueryType\Select\Query\Component\FacetSet as FacetsetComponent;
...@@ -54,7 +54,7 @@ use Solarium\QueryType\Select\Query\Component\Facet\Range as FacetRange; ...@@ -54,7 +54,7 @@ use Solarium\QueryType\Select\Query\Component\Facet\Range as FacetRange;
* Add select component FacetSet to the request * Add select component FacetSet to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class FacetSet extends RequestBuilder class FacetSet extends RequestBuilder
{ {
...@@ -97,7 +97,7 @@ class FacetSet extends RequestBuilder ...@@ -97,7 +97,7 @@ class FacetSet extends RequestBuilder
$this->addFacetRange($request, $facet); $this->addFacetRange($request, $facet);
break; break;
default: default:
throw new Solarium\Exception('Unknown facet type'); throw new Exception('Unknown facet type');
} }
} }
} }
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component Grouping to the request * Add select component Grouping to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Grouping class Grouping
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\Client\Request; ...@@ -48,7 +48,7 @@ use Solarium\Client\Request;
* Add select component Highlighting to the request * Add select component Highlighting to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Highlighting class Highlighting
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component morelikethis to the request * Add select component morelikethis to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class MoreLikeThis class MoreLikeThis
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component Spellcheck to the request * Add select component Spellcheck to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Spellcheck class Spellcheck
{ {
......
...@@ -47,7 +47,7 @@ use Solarium\Client\Request; ...@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component stats to the request * Add select component stats to the request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Stats class Stats
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder; ...@@ -48,7 +48,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder;
* Build a select request * Build a select request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Debug as DebugResult; ...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Debug as DebugResult;
* Parse select component Debug result from the data * Parse select component Debug result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Debug class Debug
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Select\ResponseParser\Component; namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium; use Solarium\Exception;
use Solarium\QueryType\Select\Query\Query; use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\FacetSet as QueryFacetSet; use Solarium\QueryType\Select\Query\Component\FacetSet as QueryFacetSet;
use Solarium\QueryType\Select\Query\Component\Facet as QueryFacet; use Solarium\QueryType\Select\Query\Component\Facet as QueryFacet;
...@@ -51,7 +51,7 @@ use Solarium\QueryType\Select\Result\Facet as ResultFacet; ...@@ -51,7 +51,7 @@ use Solarium\QueryType\Select\Result\Facet as ResultFacet;
* Parse select component FacetSet result from the data * Parse select component FacetSet result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class FacetSet class FacetSet
{ {
...@@ -82,7 +82,7 @@ class FacetSet ...@@ -82,7 +82,7 @@ class FacetSet
$result = $this->_facetRange($facet, $data); $result = $this->_facetRange($facet, $data);
break; break;
default: default:
throw new Solarium\Exception('Unknown facet type'); throw new Exception('Unknown facet type');
} }
if($result !== null) $facets[$key] = $result; if($result !== null) $facets[$key] = $result;
......
...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Grouping as GroupingResult; ...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Grouping as GroupingResult;
* Parse select component Grouping result from the data * Parse select component Grouping result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Grouping class Grouping
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Highlighting as HighlightingResult; ...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Highlighting as HighlightingResult;
* Parse select component Highlighting result from the data * Parse select component Highlighting result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Highlighting class Highlighting
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\MoreLikeThis as MoreLikeThisResult; ...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\MoreLikeThis as MoreLikeThisResult;
* Parse select component MoreLikeThis result from the data * Parse select component MoreLikeThis result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class MoreLikeThis class MoreLikeThis
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Spellcheck as SpellcheckResult; ...@@ -48,7 +48,7 @@ use Solarium\QueryType\Select\Result\Spellcheck as SpellcheckResult;
* Parse select component Highlighting result from the data * Parse select component Highlighting result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Spellcheck class Spellcheck
{ {
......
...@@ -42,13 +42,15 @@ ...@@ -42,13 +42,15 @@
namespace Solarium\QueryType\Select\ResponseParser\Component; namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\Query\Query; use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent; use Solarium\QueryType\Select\Query\Component\Stats\Stats as StatsComponent;
use Solarium\QueryType\Select\Result\Stats as StatsResult; use Solarium\QueryType\Select\Result\Stats\Stats as ResultStats;
use Solarium\QueryType\Select\Result\Stats\Result as ResultStatsResult;
use Solarium\QueryType\Select\Result\Stats\FacetValue as ResultStatsFacetValue;
/** /**
* Parse select component Stats result from the data * Parse select component Stats result from the data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class Stats class Stats
{ {
...@@ -59,7 +61,7 @@ class Stats ...@@ -59,7 +61,7 @@ class Stats
* @param Query $query * @param Query $query
* @param StatsComponent $stats * @param StatsComponent $stats
* @param array $data * @param array $data
* @return StatsResult\Result; * @return ResultStats;
*/ */
public function parse($query, $stats, $data) public function parse($query, $stats, $data)
{ {
...@@ -71,17 +73,17 @@ class Stats ...@@ -71,17 +73,17 @@ class Stats
if (isset($stats['facets'])) { if (isset($stats['facets'])) {
foreach ($stats['facets'] as $facetField => $values) { foreach ($stats['facets'] as $facetField => $values) {
foreach ($values as $value => $valueStats) { foreach ($values as $value => $valueStats) {
$stats['facets'][$facetField][$value] = new StatsResult\FacetValue( $stats['facets'][$facetField][$value] = new ResultStatsFacetValue(
$value, $valueStats $value, $valueStats
); );
} }
} }
} }
$results[$field] = new StatsResult\Result($field, $stats); $results[$field] = new ResultStatsResult($field, $stats);
} }
} }
return new StatsResult\Stats($results); return new ResultStats($results);
} }
} }
\ No newline at end of file
...@@ -47,7 +47,7 @@ use Solarium\QueryType\Select\Result\Result; ...@@ -47,7 +47,7 @@ use Solarium\QueryType\Select\Result\Result;
* Parse select response data * Parse select response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class ResponseParser extends BaseResponseParser class ResponseParser extends BaseResponseParser
{ {
......
...@@ -96,7 +96,7 @@ class FacetSet implements \IteratorAggregate, \Countable ...@@ -96,7 +96,7 @@ class FacetSet implements \IteratorAggregate, \Countable
/** /**
* IteratorAggregate implementation * IteratorAggregate implementation
* *
* @return ArrayIterator * @return \ArrayIterator
*/ */
public function getIterator() public function getIterator()
{ {
......
...@@ -257,7 +257,7 @@ class Result extends BaseResult implements \IteratorAggregate, \Countable ...@@ -257,7 +257,7 @@ class Result extends BaseResult implements \IteratorAggregate, \Countable
* *
* This is a convenience method that maps presets to getComponent * This is a convenience method that maps presets to getComponent
* *
* @return FacetSet\Result * @return FacetSet
*/ */
public function getFacetSet() public function getFacetSet()
{ {
......
...@@ -47,8 +47,7 @@ namespace Solarium\QueryType\Select\Result\Stats; ...@@ -47,8 +47,7 @@ namespace Solarium\QueryType\Select\Result\Stats;
* @package Solarium * @package Solarium
* @subpackage Result * @subpackage Result
*/ */
class Stats class Stats implements \IteratorAggregate, \Countable
implements \IteratorAggregate, \Countable
{ {
/** /**
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Suggester; namespace Solarium\QueryType\Suggester;
use Solarium\Client;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\Client\RequestBuilder as BaseRequestBuilder; use Solarium\Client\RequestBuilder as BaseRequestBuilder;
...@@ -48,7 +47,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder; ...@@ -48,7 +47,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder;
* Build a Suggester query request * Build a Suggester query request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser; ...@@ -48,7 +48,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser;
* Parse Suggester response data * Parse Suggester response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class ResponseParser extends BaseResponseParser class ResponseParser extends BaseResponseParser
{ {
......
...@@ -50,7 +50,7 @@ use Solarium\Client\Request; ...@@ -50,7 +50,7 @@ use Solarium\Client\Request;
* Build a Terms query request * Build a Terms query request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
......
...@@ -48,7 +48,7 @@ use Solarium\Client\Request; ...@@ -48,7 +48,7 @@ use Solarium\Client\Request;
* Parse MoreLikeThis response data * Parse MoreLikeThis response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class ResponseParser extends BaseResponseParser class ResponseParser extends BaseResponseParser
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Update\Query\Command; namespace Solarium\QueryType\Update\Query\Command;
use Solarium; use Solarium\Configurable;
use Solarium\QueryType\Update\Query\Query as UpdateQuery; use Solarium\QueryType\Update\Query\Query as UpdateQuery;
/** /**
...@@ -49,7 +49,7 @@ use Solarium\QueryType\Update\Query\Query as UpdateQuery; ...@@ -49,7 +49,7 @@ use Solarium\QueryType\Update\Query\Query as UpdateQuery;
* @package Solarium * @package Solarium
* @subpackage Query * @subpackage Query
*/ */
abstract class Command extends Solarium\Configurable abstract class Command extends Configurable
{ {
/** /**
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Update\Query; namespace Solarium\QueryType\Update\Query;
use Solarium; use Solarium\Exception;
use Solarium\Document\ReadWrite as ReadWriteDocument; use Solarium\Document\ReadWrite as ReadWriteDocument;
use Solarium\Client\Client; use Solarium\Client\Client;
use Solarium\Query\Query as BaseQuery; use Solarium\Query\Query as BaseQuery;
...@@ -143,7 +143,7 @@ class Query extends BaseQuery ...@@ -143,7 +143,7 @@ class Query extends BaseQuery
$type = $value['type']; $type = $value['type'];
if ($type == self::COMMAND_ADD) { if ($type == self::COMMAND_ADD) {
throw new Solarium\Exception( throw new Exception(
"Adding documents is not supported in configuration, use the API for this" "Adding documents is not supported in configuration, use the API for this"
); );
} }
...@@ -167,7 +167,7 @@ class Query extends BaseQuery ...@@ -167,7 +167,7 @@ class Query extends BaseQuery
$type = strtolower($type); $type = strtolower($type);
if (!isset($this->_commandTypes[$type])) { if (!isset($this->_commandTypes[$type])) {
throw new Solarium\Exception("Update commandtype unknown: " . $type); throw new Exception("Update commandtype unknown: " . $type);
} }
$class = $this->_commandTypes[$type]; $class = $this->_commandTypes[$type];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\QueryType\Update; namespace Solarium\QueryType\Update;
use Solarium; use Solarium\Exception;
use Solarium\Client; use Solarium\Client;
use Solarium\Client\Request; use Solarium\Client\Request;
use Solarium\QueryType\Update\Query\Query as UpdateQuery; use Solarium\QueryType\Update\Query\Query as UpdateQuery;
...@@ -50,7 +50,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder; ...@@ -50,7 +50,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder;
* Build an update request * Build an update request
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class RequestBuilder extends BaseRequestBuilder class RequestBuilder extends BaseRequestBuilder
{ {
...@@ -76,7 +76,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -76,7 +76,7 @@ class RequestBuilder extends BaseRequestBuilder
* Each commandtype is delegated to a separate builder method. * Each commandtype is delegated to a separate builder method.
* *
* @param UpdateQuery $query * @param UpdateQuery $query
* @throws Solarium\Exception * @throws Exception
* @return string * @return string
*/ */
public function getRawData($query) public function getRawData($query)
...@@ -100,7 +100,7 @@ class RequestBuilder extends BaseRequestBuilder ...@@ -100,7 +100,7 @@ class RequestBuilder extends BaseRequestBuilder
$xml .= $this->buildRollbackXml(); $xml .= $this->buildRollbackXml();
break; break;
default: default:
throw new Solarium\Exception('Unsupported command type'); throw new Exception('Unsupported command type');
break; break;
} }
} }
......
...@@ -46,7 +46,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser; ...@@ -46,7 +46,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser;
* Parse update response data * Parse update response data
* *
* @package Solarium * @package Solarium
* @subpackage Client * @subpackage QueryType
*/ */
class ResponseParser extends BaseResponseParser class ResponseParser extends BaseResponseParser
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Result; namespace Solarium\Result;
use Solarium; use Solarium\Exception;
/** /**
* QueryType result * QueryType result
...@@ -71,7 +71,7 @@ class QueryType extends Result ...@@ -71,7 +71,7 @@ class QueryType extends Result
$queryType = $this->_query->getType(); $queryType = $this->_query->getType();
$queryTypes = $this->_client->getQueryTypes(); $queryTypes = $this->_client->getQueryTypes();
if (!isset($queryTypes[$queryType])) { if (!isset($queryTypes[$queryType])) {
throw new Solarium\Exception('No responseparser registered for querytype: '. $queryType); throw new Exception('No responseparser registered for querytype: '. $queryType);
} }
$responseParserClass = $queryTypes[$queryType]['responseparser']; $responseParserClass = $queryTypes[$queryType]['responseparser'];
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* @namespace * @namespace
*/ */
namespace Solarium\Result; namespace Solarium\Result;
use Solarium; use Solarium\Exception;
use Solarium\Client\Client; use Solarium\Client\Client;
use Solarium\Client\Response; use Solarium\Client\Response;
use Solarium\Client\HttpException; use Solarium\Client\HttpException;
...@@ -147,7 +147,7 @@ class Result ...@@ -147,7 +147,7 @@ class Result
if (null == $this->_data) { if (null == $this->_data) {
$this->_data = json_decode($this->_response->getBody(), true); $this->_data = json_decode($this->_response->getBody(), true);
if (null === $this->_data) { if (null === $this->_data) {
throw new Solarium\Exception( throw new Exception(
'Solr JSON response could not be decoded' 'Solr JSON response could not be decoded'
); );
} }
......
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