Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
solarium
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
solarium
Commits
84906155
Commit
84906155
authored
Feb 19, 2012
by
Bas de Nooijer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lots of fixes in namespaces and phpdoc
parent
3f72e644
Changes
63
Hide whitespace changes
Inline
Side-by-side
Showing
63 changed files
with
142 additions
and
142 deletions
+142
-142
library/Solarium/Client/Adapter/Curl.php
library/Solarium/Client/Adapter/Curl.php
+6
-6
library/Solarium/Client/Adapter/Http.php
library/Solarium/Client/Adapter/Http.php
+5
-5
library/Solarium/Client/Adapter/PeclHttp.php
library/Solarium/Client/Adapter/PeclHttp.php
+6
-6
library/Solarium/Client/Adapter/ZendHttp.php
library/Solarium/Client/Adapter/ZendHttp.php
+3
-3
library/Solarium/Client/Client.php
library/Solarium/Client/Client.php
+6
-6
library/Solarium/Configurable.php
library/Solarium/Configurable.php
+2
-2
library/Solarium/Document/ReadOnly.php
library/Solarium/Document/ReadOnly.php
+2
-2
library/Solarium/Plugin/BufferedAdd.php
library/Solarium/Plugin/BufferedAdd.php
+1
-1
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
...ary/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
+4
-4
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
+8
-7
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
...ary/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
+3
-3
library/Solarium/Query/Helper.php
library/Solarium/Query/Helper.php
+4
-4
library/Solarium/QueryType/Analysis/Query/Field.php
library/Solarium/QueryType/Analysis/Query/Field.php
+1
-1
library/Solarium/QueryType/Analysis/RequestBuilder/Document.php
...y/Solarium/QueryType/Analysis/RequestBuilder/Document.php
+1
-1
library/Solarium/QueryType/Analysis/RequestBuilder/RequestBuilder.php
...rium/QueryType/Analysis/RequestBuilder/RequestBuilder.php
+1
-1
library/Solarium/QueryType/Analysis/ResponseParser/Document.php
...y/Solarium/QueryType/Analysis/ResponseParser/Document.php
+1
-1
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
+1
-1
library/Solarium/QueryType/Analysis/Result/Types.php
library/Solarium/QueryType/Analysis/Result/Types.php
+1
-1
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
+1
-1
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
+1
-1
library/Solarium/QueryType/MoreLikeThis/Result.php
library/Solarium/QueryType/MoreLikeThis/Result.php
+5
-5
library/Solarium/QueryType/Ping/RequestBuilder.php
library/Solarium/QueryType/Ping/RequestBuilder.php
+1
-2
library/Solarium/QueryType/Select/Query/Component/Component.php
...y/Solarium/QueryType/Select/Query/Component/Component.php
+2
-2
library/Solarium/QueryType/Select/Query/Component/Facet/Facet.php
...Solarium/QueryType/Select/Query/Component/Facet/Facet.php
+2
-2
library/Solarium/QueryType/Select/Query/Component/Facet/MultiQuery.php
...ium/QueryType/Select/Query/Component/Facet/MultiQuery.php
+3
-3
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
...ry/Solarium/QueryType/Select/Query/Component/FacetSet.php
+4
-4
library/Solarium/QueryType/Select/Query/Component/Highlighting/Field.php
...m/QueryType/Select/Query/Component/Highlighting/Field.php
+2
-2
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
...Type/Select/Query/Component/Highlighting/Highlighting.php
+2
-2
library/Solarium/QueryType/Select/Query/Component/Stats/Field.php
...Solarium/QueryType/Select/Query/Component/Stats/Field.php
+2
-2
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
...Solarium/QueryType/Select/Query/Component/Stats/Stats.php
+3
-3
library/Solarium/QueryType/Select/Query/FilterQuery.php
library/Solarium/QueryType/Select/Query/FilterQuery.php
+2
-2
library/Solarium/QueryType/Select/Query/Query.php
library/Solarium/QueryType/Select/Query/Query.php
+6
-6
library/Solarium/QueryType/Select/RequestBuilder/Component/Debug.php
...arium/QueryType/Select/RequestBuilder/Component/Debug.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
...rium/QueryType/Select/RequestBuilder/Component/DisMax.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/DistributedSearch.php
...ype/Select/RequestBuilder/Component/DistributedSearch.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
...um/QueryType/Select/RequestBuilder/Component/FacetSet.php
+3
-3
library/Solarium/QueryType/Select/RequestBuilder/Component/Grouping.php
...um/QueryType/Select/RequestBuilder/Component/Grouping.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/Highlighting.php
...ueryType/Select/RequestBuilder/Component/Highlighting.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/MoreLikeThis.php
...ueryType/Select/RequestBuilder/Component/MoreLikeThis.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/Spellcheck.php
.../QueryType/Select/RequestBuilder/Component/Spellcheck.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/Component/Stats.php
...arium/QueryType/Select/RequestBuilder/Component/Stats.php
+1
-1
library/Solarium/QueryType/Select/RequestBuilder/RequestBuilder.php
...larium/QueryType/Select/RequestBuilder/RequestBuilder.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/Debug.php
...arium/QueryType/Select/ResponseParser/Component/Debug.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/FacetSet.php
...um/QueryType/Select/ResponseParser/Component/FacetSet.php
+3
-3
library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
...um/QueryType/Select/ResponseParser/Component/Grouping.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/Highlighting.php
...ueryType/Select/ResponseParser/Component/Highlighting.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
...ueryType/Select/ResponseParser/Component/MoreLikeThis.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
.../QueryType/Select/ResponseParser/Component/Spellcheck.php
+1
-1
library/Solarium/QueryType/Select/ResponseParser/Component/Stats.php
...arium/QueryType/Select/ResponseParser/Component/Stats.php
+8
-6
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
...larium/QueryType/Select/ResponseParser/ResponseParser.php
+1
-1
library/Solarium/QueryType/Select/Result/FacetSet.php
library/Solarium/QueryType/Select/Result/FacetSet.php
+1
-1
library/Solarium/QueryType/Select/Result/Result.php
library/Solarium/QueryType/Select/Result/Result.php
+1
-1
library/Solarium/QueryType/Select/Result/Stats/Stats.php
library/Solarium/QueryType/Select/Result/Stats/Stats.php
+1
-2
library/Solarium/QueryType/Suggester/RequestBuilder.php
library/Solarium/QueryType/Suggester/RequestBuilder.php
+1
-2
library/Solarium/QueryType/Suggester/ResponseParser.php
library/Solarium/QueryType/Suggester/ResponseParser.php
+1
-1
library/Solarium/QueryType/Terms/RequestBuilder.php
library/Solarium/QueryType/Terms/RequestBuilder.php
+1
-1
library/Solarium/QueryType/Terms/ResponseParser.php
library/Solarium/QueryType/Terms/ResponseParser.php
+1
-1
library/Solarium/QueryType/Update/Query/Command/Command.php
library/Solarium/QueryType/Update/Query/Command/Command.php
+2
-2
library/Solarium/QueryType/Update/Query/Query.php
library/Solarium/QueryType/Update/Query/Query.php
+3
-3
library/Solarium/QueryType/Update/RequestBuilder.php
library/Solarium/QueryType/Update/RequestBuilder.php
+4
-4
library/Solarium/QueryType/Update/ResponseParser.php
library/Solarium/QueryType/Update/ResponseParser.php
+1
-1
library/Solarium/Result/QueryType.php
library/Solarium/Result/QueryType.php
+2
-2
library/Solarium/Result/Result.php
library/Solarium/Result/Result.php
+2
-2
No files found.
library/Solarium/Client/Adapter/Curl.php
View file @
84906155
...
...
@@ -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"
);
}
}
}
library/Solarium/Client/Adapter/Http.php
View file @
84906155
...
...
@@ -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"
);
}
}
...
...
library/Solarium/Client/Adapter/PeclHttp.php
View file @
84906155
...
...
@@ -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
()
);
}
...
...
library/Solarium/Client/Adapter/ZendHttp.php
View file @
84906155
...
...
@@ -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
()
{
...
...
library/Solarium/Client/Client.php
View file @
84906155
...
...
@@ -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\Plugin
AbstractPlugin'
);
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'
];
...
...
library/Solarium/Configurable.php
View file @
84906155
...
...
@@ -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)
*
...
...
library/Solarium/Document/ReadOnly.php
View file @
84906155
...
...
@@ -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'
);
}
/**
...
...
library/Solarium/Plugin/BufferedAdd.php
View file @
84906155
...
...
@@ -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
;
/**
...
...
library/Solarium/Plugin/CustomizeRequest/CustomizeRequest.php
View file @
84906155
...
...
@@ -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
...
...
library/Solarium/Plugin/Loadbalancer/Loadbalancer.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/Plugin/Loadbalancer/WeightedRandomChoice.php
View file @
84906155
...
...
@@ -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
...
...
library/Solarium/Query/Helper.php
View file @
84906155
...
...
@@ -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
)
...
...
library/Solarium/QueryType/Analysis/Query/Field.php
View file @
84906155
...
...
@@ -46,7 +46,7 @@ use Solarium\Client\Client;
* Analysis document query
*
* @package Solarium
* @subpackage Query
* @subpackage Query
Type
*/
class
Field
extends
Query
{
...
...
library/Solarium/QueryType/Analysis/RequestBuilder/Document.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Build a document analysis request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Document
extends
BaseRequestBuilder
{
...
...
library/Solarium/QueryType/Analysis/RequestBuilder/RequestBuilder.php
View file @
84906155
...
...
@@ -49,7 +49,7 @@ use Solarium\QueryType\Analysis\Query\Query;
* Build an analysis request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
RequestBuilder
extends
BaseRequestBuilder
{
...
...
library/Solarium/QueryType/Analysis/ResponseParser/Document.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Analysis/ResponseParser/Field.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Analysis/Result/Types.php
View file @
84906155
...
...
@@ -45,7 +45,7 @@ namespace Solarium\QueryType\Analysis\Result;
* Analysis types result
*
* @package Solarium
* @subpackage
Result
* @subpackage
QueryType
*/
class
Types
extends
ResultList
{
...
...
library/Solarium/QueryType/MoreLikeThis/RequestBuilder.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/MoreLikeThis/ResponseParser.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/MoreLikeThis/Result.php
View file @
84906155
...
...
@@ -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
;
...
...
library/Solarium/QueryType/Ping/RequestBuilder.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/Query/Component/Component.php
View file @
84906155
...
...
@@ -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
{
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/Facet.php
View file @
84906155
...
...
@@ -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
{
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Facet/MultiQuery.php
View file @
84906155
...
...
@@ -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
...
...
library/Solarium/QueryType/Select/Query/Component/FacetSet.php
View file @
84906155
...
...
@@ -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
];
...
...
library/Solarium/QueryType/Select/Query/Component/Highlighting/Field.php
View file @
84906155
...
...
@@ -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
...
...
library/Solarium/QueryType/Select/Query/Component/Highlighting/Highlighting.php
View file @
84906155
...
...
@@ -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
;
...
...
library/Solarium/QueryType/Select/Query/Component/Stats/Field.php
View file @
84906155
...
...
@@ -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
{
/**
...
...
library/Solarium/QueryType/Select/Query/Component/Stats/Stats.php
View file @
84906155
...
...
@@ -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
;
}
...
...
library/Solarium/QueryType/Select/Query/FilterQuery.php
View file @
84906155
...
...
@@ -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
{
/**
...
...
library/Solarium/QueryType/Select/Query/Query.php
View file @
84906155
...
...
@@ -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
()
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Debug.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component debug to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Debug
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/DisMax.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component dismax to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
DisMax
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/DistributedSearch.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component distributedsearch to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
DistributedSearch
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/FacetSet.php
View file @
84906155
...
...
@@ -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'
);
}
}
}
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Grouping.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component Grouping to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Grouping
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Highlighting.php
View file @
84906155
...
...
@@ -48,7 +48,7 @@ use Solarium\Client\Request;
* Add select component Highlighting to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Highlighting
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/MoreLikeThis.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component morelikethis to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
MoreLikeThis
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Spellcheck.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component Spellcheck to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Spellcheck
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/Component/Stats.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\Client\Request;
* Add select component stats to the request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
Stats
{
...
...
library/Solarium/QueryType/Select/RequestBuilder/RequestBuilder.php
View file @
84906155
...
...
@@ -48,7 +48,7 @@ use Solarium\Client\RequestBuilder as BaseRequestBuilder;
* Build a select request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
RequestBuilder
extends
BaseRequestBuilder
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Debug.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/FacetSet.php
View file @
84906155
...
...
@@ -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
;
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Grouping.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Highlighting.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/MoreLikeThis.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Spellcheck.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Select/ResponseParser/Component/Stats.php
View file @
84906155
...
...
@@ -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
ResultStats
FacetValue
(
$value
,
$valueStats
);
}
}
}
$results
[
$field
]
=
new
StatsResult\
Result
(
$field
,
$stats
);
$results
[
$field
]
=
new
ResultStats
Result
(
$field
,
$stats
);
}
}
return
new
StatsResult\
Stats
(
$results
);
return
new
Result
Stats
(
$results
);
}
}
\ No newline at end of file
library/Solarium/QueryType/Select/ResponseParser/ResponseParser.php
View file @
84906155
...
...
@@ -47,7 +47,7 @@ use Solarium\QueryType\Select\Result\Result;
* Parse select response data
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
ResponseParser
extends
BaseResponseParser
{
...
...
library/Solarium/QueryType/Select/Result/FacetSet.php
View file @
84906155
...
...
@@ -96,7 +96,7 @@ class FacetSet implements \IteratorAggregate, \Countable
/**
* IteratorAggregate implementation
*
* @return ArrayIterator
* @return
\
ArrayIterator
*/
public
function
getIterator
()
{
...
...
library/Solarium/QueryType/Select/Result/Result.php
View file @
84906155
...
...
@@ -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
()
{
...
...
library/Solarium/QueryType/Select/Result/Stats/Stats.php
View file @
84906155
...
...
@@ -47,8 +47,7 @@ namespace Solarium\QueryType\Select\Result\Stats;
* @package Solarium
* @subpackage Result
*/
class
Stats
implements
\IteratorAggregate
,
\Countable
class
Stats
implements
\IteratorAggregate
,
\Countable
{
/**
...
...
library/Solarium/QueryType/Suggester/RequestBuilder.php
View file @
84906155
...
...
@@ -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
{
...
...
library/Solarium/QueryType/Suggester/ResponseParser.php
View file @
84906155
...
...
@@ -48,7 +48,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser;
* Parse Suggester response data
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
ResponseParser
extends
BaseResponseParser
{
...
...
library/Solarium/QueryType/Terms/RequestBuilder.php
View file @
84906155
...
...
@@ -50,7 +50,7 @@ use Solarium\Client\Request;
* Build a Terms query request
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
RequestBuilder
extends
BaseRequestBuilder
{
...
...
library/Solarium/QueryType/Terms/ResponseParser.php
View file @
84906155
...
...
@@ -48,7 +48,7 @@ use Solarium\Client\Request;
* Parse MoreLikeThis response data
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
ResponseParser
extends
BaseResponseParser
{
...
...
library/Solarium/QueryType/Update/Query/Command/Command.php
View file @
84906155
...
...
@@ -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
{
/**
...
...
library/Solarium/QueryType/Update/Query/Query.php
View file @
84906155
...
...
@@ -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
];
...
...
library/Solarium/QueryType/Update/RequestBuilder.php
View file @
84906155
...
...
@@ -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
;
}
}
...
...
library/Solarium/QueryType/Update/ResponseParser.php
View file @
84906155
...
...
@@ -46,7 +46,7 @@ use Solarium\Client\ResponseParser as BaseResponseParser;
* Parse update response data
*
* @package Solarium
* @subpackage
Client
* @subpackage
QueryType
*/
class
ResponseParser
extends
BaseResponseParser
{
...
...
library/Solarium/Result/QueryType.php
View file @
84906155
...
...
@@ -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'
];
...
...
library/Solarium/Result/Result.php
View file @
84906155
...
...
@@ -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'
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment