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