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