Commit 1f2d8c10 authored by Bas de Nooijer's avatar Bas de Nooijer

Code style and docblox fixes

parent 1d4034e9
...@@ -89,6 +89,13 @@ class Solarium_Client_Adapter_Curl extends Solarium_Client_Adapter ...@@ -89,6 +89,13 @@ class Solarium_Client_Adapter_Curl extends Solarium_Client_Adapter
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd
} }
/**
* Get the response for a curl handle
*
* @param resource $handle
* @param string $httpResponse
* @return Solarium_Client_Response
*/
public function getResponse($handle, $httpResponse) public function getResponse($handle, $httpResponse)
{ {
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
......
...@@ -52,8 +52,10 @@ class Solarium_Client_RequestBuilder_Select_Component_Highlighting ...@@ -52,8 +52,10 @@ class Solarium_Client_RequestBuilder_Select_Component_Highlighting
* @param Solarium_Client_Request $request * @param Solarium_Client_Request $request
* @return Solarium_Client_Request * @return Solarium_Client_Request
*/ */
public function buildComponent(Solarium_Query_Select_Component_Highlighting $component, Solarium_Client_Request $request) public function buildComponent(
{ Solarium_Query_Select_Component_Highlighting $component,
Solarium_Client_Request $request
){
// enable highlighting // enable highlighting
$request->addParam('hl', 'true'); $request->addParam('hl', 'true');
......
...@@ -183,7 +183,7 @@ class Solarium_Plugin_BufferedAdd extends Solarium_Plugin_Abstract ...@@ -183,7 +183,7 @@ class Solarium_Plugin_BufferedAdd extends Solarium_Plugin_Abstract
*/ */
public function flush($overwrite = null, $commitWithin = null) public function flush($overwrite = null, $commitWithin = null)
{ {
if(count($this->_buffer) == 0) { if (count($this->_buffer) == 0) {
// nothing to do // nothing to do
return false; return false;
} }
......
...@@ -45,9 +45,13 @@ class Solarium_Plugin_CustomizeRequest_Customization extends Solarium_Configurab ...@@ -45,9 +45,13 @@ class Solarium_Plugin_CustomizeRequest_Customization extends Solarium_Configurab
{ {
/** /**
* Type definitions * Type definition for params
*/ */
const TYPE_PARAM = 'param'; const TYPE_PARAM = 'param';
/**
* Type definition for headers
*/
const TYPE_HEADER = 'header'; const TYPE_HEADER = 'header';
/** /**
......
...@@ -68,7 +68,7 @@ class Solarium_Plugin_ParallelExecution extends Solarium_Plugin_Abstract ...@@ -68,7 +68,7 @@ class Solarium_Plugin_ParallelExecution extends Solarium_Plugin_Abstract
// create handles and add all handles to the multihandle // create handles and add all handles to the multihandle
$multiHandle = curl_multi_init(); $multiHandle = curl_multi_init();
$handles = array(); $handles = array();
foreach($queries as $key => $query) { foreach ($queries as $key => $query) {
$request = $this->_client->createRequest($query); $request = $this->_client->createRequest($query);
$handle = $adapter->createHandle($request); $handle = $adapter->createHandle($request);
curl_multi_add_handle($multiHandle, $handle); curl_multi_add_handle($multiHandle, $handle);
......
...@@ -57,16 +57,22 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen ...@@ -57,16 +57,22 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen
); );
/** /**
* Query instance to execute
*
* @var Solarium_Query_Select * @var Solarium_Query_Select
*/ */
protected $_query; protected $_query;
/** /**
* Start position (offset)
*
* @var int * @var int
*/ */
protected $_start = 0; protected $_start = 0;
/** /**
* Last resultset from the query instance
*
* @var Solarium_Result_Select * @var Solarium_Result_Select
*/ */
protected $_result; protected $_result;
...@@ -79,6 +85,8 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen ...@@ -79,6 +85,8 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen
protected $_position; protected $_position;
/** /**
* Documents from the last resultset
*
* @var array * @var array
*/ */
protected $_documents; protected $_documents;
...@@ -142,11 +150,12 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen ...@@ -142,11 +150,12 @@ class Solarium_Plugin_PrefetchIterator extends Solarium_Plugin_Abstract implemen
/** /**
* Iterator implementation * Iterator implementation
*/ */
function rewind() { function rewind()
{
$this->_position = 0; $this->_position = 0;
// this condition prevent useless re-fetching of data if a count is done before the iterator is used // this condition prevent useless re-fetching of data if a count is done before the iterator is used
if($this->_start !== $this->_options['prefetch']) { if ($this->_start !== $this->_options['prefetch']) {
$this->_start = 0; $this->_start = 0;
} }
} }
......
...@@ -69,6 +69,9 @@ class Solarium_Query_Helper ...@@ -69,6 +69,9 @@ class Solarium_Query_Helper
protected $_derefencedParamsLastKey = 0; protected $_derefencedParamsLastKey = 0;
/** /**
* Solarium_Query instance, optional.
* Used for dereferenced params.
*
* @var Solarium_Query * @var Solarium_Query
*/ */
protected $_query; protected $_query;
...@@ -78,7 +81,8 @@ class Solarium_Query_Helper ...@@ -78,7 +81,8 @@ class Solarium_Query_Helper
* *
* @param Solarium_Query $query * @param Solarium_Query $query
*/ */
public function __construct($query = null) { public function __construct($query = null)
{
$this->_query = $query; $this->_query = $query;
} }
...@@ -291,14 +295,14 @@ class Solarium_Query_Helper ...@@ -291,14 +295,14 @@ class Solarium_Query_Helper
{ {
if ($dereferenced) { if ($dereferenced) {
if(!$this->_query) { if (!$this->_query) {
throw new Solarium_Exception( throw new Solarium_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'
); );
} }
foreach($params as $paramKey => $paramValue) { foreach ($params as $paramKey => $paramValue) {
$this->_derefencedParamsLastKey++; $this->_derefencedParamsLastKey++;
$derefKey = 'deref_' . $this->_derefencedParamsLastKey; $derefKey = 'deref_' . $this->_derefencedParamsLastKey;
$this->_query->addParam($derefKey, $paramValue); $this->_query->addParam($derefKey, $paramValue);
......
...@@ -72,6 +72,8 @@ class Solarium_Result ...@@ -72,6 +72,8 @@ class Solarium_Result
protected $_query; protected $_query;
/** /**
* Solarium client instance
*
* @var Solarium_Client * @var Solarium_Client
*/ */
protected $_client; protected $_client;
......
...@@ -46,41 +46,57 @@ class Solarium_Result_Analysis_Item ...@@ -46,41 +46,57 @@ class Solarium_Result_Analysis_Item
{ {
/** /**
* Text string
*
* @var string * @var string
*/ */
protected $_text; protected $_text;
/** /**
* RawText string
*
* @var string * @var string
*/ */
protected $_rawText; protected $_rawText;
/** /**
* Start
*
* @var int * @var int
*/ */
protected $_start; protected $_start;
/** /**
* End
*
* @var int * @var int
*/ */
protected $_end; protected $_end;
/** /**
* Position
*
* @var int * @var int
*/ */
protected $_position; protected $_position;
/** /**
* Position history
*
* @var array * @var array
*/ */
protected $_positionHistory; protected $_positionHistory;
/** /**
* Type
*
* @var string * @var string
*/ */
protected $_type; protected $_type;
/** /**
* Match
*
* @var boolean * @var boolean
*/ */
protected $_match = false; protected $_match = false;
......
...@@ -46,11 +46,15 @@ class Solarium_Result_Analysis_List implements IteratorAggregate, Countable ...@@ -46,11 +46,15 @@ class Solarium_Result_Analysis_List implements IteratorAggregate, Countable
{ {
/** /**
* List name
*
* @var string * @var string
*/ */
protected $_name; protected $_name;
/** /**
* List items
*
* @var array * @var array
*/ */
protected $_items; protected $_items;
......
...@@ -46,36 +46,50 @@ class Solarium_Result_Select_Debug implements IteratorAggregate, Countable ...@@ -46,36 +46,50 @@ class Solarium_Result_Select_Debug implements IteratorAggregate, Countable
{ {
/** /**
* QueryString
*
* @var string * @var string
*/ */
protected $_queryString; protected $_queryString;
/** /**
* ParsedQuery
*
* @var string * @var string
*/ */
protected $_parsedQuery; protected $_parsedQuery;
/** /**
* QueryParser
*
* @var string * @var string
*/ */
protected $_queryParser; protected $_queryParser;
/** /**
* OtherQuery
*
* @var string * @var string
*/ */
protected $_otherQuery; protected $_otherQuery;
/** /**
* Explain instance
*
* @var Solarium_Result_Select_Debug_DocumentSet * @var Solarium_Result_Select_Debug_DocumentSet
*/ */
protected $_explain; protected $_explain;
/** /**
* ExplainOther instance
*
* @var Solarium_Result_Select_Debug_DocumentSet * @var Solarium_Result_Select_Debug_DocumentSet
*/ */
protected $_explainOther; protected $_explainOther;
/** /**
* Timing instance
*
* @var Solarium_Result_Select_Debug_Timing * @var Solarium_Result_Select_Debug_Timing
*/ */
protected $_timing; protected $_timing;
......
...@@ -46,16 +46,22 @@ class Solarium_Result_Select_Debug_Detail ...@@ -46,16 +46,22 @@ class Solarium_Result_Select_Debug_Detail
{ {
/** /**
* Value
*
* @var float * @var float
*/ */
protected $_value; protected $_value;
/** /**
* Match
*
* @var boolean * @var boolean
*/ */
protected $_match; protected $_match;
/** /**
* Description
*
* @var string * @var string
*/ */
protected $_description; protected $_description;
......
...@@ -47,11 +47,15 @@ class Solarium_Result_Select_Debug_Document extends Solarium_Result_Select_Debug ...@@ -47,11 +47,15 @@ class Solarium_Result_Select_Debug_Document extends Solarium_Result_Select_Debug
{ {
/** /**
* Key
*
* @var string * @var string
*/ */
protected $_key; protected $_key;
/** /**
* Details
*
* @var array * @var array
*/ */
protected $_details; protected $_details;
...@@ -63,6 +67,7 @@ class Solarium_Result_Select_Debug_Document extends Solarium_Result_Select_Debug ...@@ -63,6 +67,7 @@ class Solarium_Result_Select_Debug_Document extends Solarium_Result_Select_Debug
* @param boolean $match * @param boolean $match
* @param float $value * @param float $value
* @param string $description * @param string $description
* @param array $details
*/ */
public function __construct($key, $match, $value, $description, $details) public function __construct($key, $match, $value, $description, $details)
{ {
......
...@@ -46,6 +46,8 @@ class Solarium_Result_Select_Debug_Timing implements IteratorAggregate, Countabl ...@@ -46,6 +46,8 @@ class Solarium_Result_Select_Debug_Timing implements IteratorAggregate, Countabl
{ {
/** /**
* Time
*
* @var float * @var float
*/ */
protected $_time; protected $_time;
......
...@@ -47,11 +47,15 @@ class Solarium_Result_Select_Debug_TimingPhase ...@@ -47,11 +47,15 @@ class Solarium_Result_Select_Debug_TimingPhase
{ {
/** /**
* Phase name
*
* @var string * @var string
*/ */
protected $_name; protected $_name;
/** /**
* Phase time
*
* @var float * @var float
*/ */
protected $_time; protected $_time;
......
...@@ -60,6 +60,8 @@ class Solarium_Result_Select_Spellcheck implements IteratorAggregate, Countable ...@@ -60,6 +60,8 @@ class Solarium_Result_Select_Spellcheck implements IteratorAggregate, Countable
protected $_collation; protected $_collation;
/** /**
* Correctly spelled?
*
* @var boolean * @var boolean
*/ */
protected $_correctlySpelled; protected $_correctlySpelled;
......
...@@ -46,16 +46,22 @@ class Solarium_Result_Select_Spellcheck_Collation implements IteratorAggregate, ...@@ -46,16 +46,22 @@ class Solarium_Result_Select_Spellcheck_Collation implements IteratorAggregate,
{ {
/** /**
* Query
*
* @var string * @var string
*/ */
protected $_query; protected $_query;
/** /**
* Hit count
*
* @var int * @var int
*/ */
protected $_hits; protected $_hits;
/** /**
* Corrections
*
* @var array * @var array
*/ */
protected $_corrections; protected $_corrections;
......
...@@ -121,7 +121,7 @@ class Solarium_Result_Suggester extends Solarium_Result_QueryType implements Ite ...@@ -121,7 +121,7 @@ class Solarium_Result_Suggester extends Solarium_Result_QueryType implements Ite
/** /**
* Get results for a specific term * Get results for a specific term
* *
* @param string $field * @param string $term
* @return array * @return array
*/ */
public function getTerm($term) public function getTerm($term)
......
...@@ -46,21 +46,29 @@ class Solarium_Result_Suggester_Term implements IteratorAggregate, Countable ...@@ -46,21 +46,29 @@ class Solarium_Result_Suggester_Term implements IteratorAggregate, Countable
{ {
/** /**
* NumFound
*
* @var int * @var int
*/ */
protected $_numFound; protected $_numFound;
/** /**
* StartOffset
*
* @var int * @var int
*/ */
protected $_startOffset; protected $_startOffset;
/** /**
* EndOffset
*
* @var int * @var int
*/ */
protected $_endOffset; protected $_endOffset;
/** /**
* Suggestions
*
* @var array * @var array
*/ */
protected $_suggestions; protected $_suggestions;
......
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