Commit 43c97027 authored by Dorian Villet's avatar Dorian Villet

Fix indentations, spaces after namespaces, and a few if() fixes.

parent a2a33ee8
......@@ -148,7 +148,7 @@ class Curl extends Configurable implements AdapterInterface
curl_setopt($handler, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($handler, CURLOPT_TIMEOUT, $options['timeout']);
if ( $proxy = $this->getOption('proxy') ) {
if ($proxy = $this->getOption('proxy')) {
curl_setopt($handler, CURLOPT_PROXY, $proxy);
}
......@@ -158,9 +158,11 @@ class Curl extends Configurable implements AdapterInterface
// Try endpoint authentication first, fallback to request for backwards compatibility
$authData = $endpoint->getAuthentication();
if (empty($authData['username'])) $authData = $request->getAuthentication();
if (empty($authData['username'])) {
$authData = $request->getAuthentication();
}
if ( !empty($authData['username']) && !empty($authData['password'])) {
if (!empty($authData['username']) && !empty($authData['password'])) {
curl_setopt($handler, CURLOPT_USERPWD, $authData['username']. ':' . $authData['password'] );
curl_setopt($handler, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
}
......
......@@ -129,10 +129,14 @@ class Http extends Configurable implements AdapterInterface
// Try endpoint authentication first, fallback to request for backwards compatibility
$authData = $endpoint->getAuthentication();
if (empty($authData['username'])) $authData = $request->getAuthentication();
if (empty($authData['username'])) {
$authData = $request->getAuthentication();
}
if ( !empty($authData['username']) && !empty($authData['password'])) {
$request->addHeader('Authorization: Basic ' . base64_encode($authData['username']. ':' . $authData['password'] ));
if (!empty($authData['username']) && !empty($authData['password'])) {
$request->addHeader(
'Authorization: Basic ' . base64_encode($authData['username'] . ':' . $authData['password'])
);
}
$headers = $request->getHeaders();
......
......@@ -153,9 +153,11 @@ class PeclHttp extends Configurable implements AdapterInterface
// Try endpoint authentication first, fallback to request for backwards compatibility
$authData = $endpoint->getAuthentication();
if (empty($authData['username'])) $authData = $request->getAuthentication();
if (empty($authData['username'])) {
$authData = $request->getAuthentication();
}
if ( !empty($authData['username']) && !empty($authData['password'])) {
if (!empty($authData['username']) && !empty($authData['password'])) {
$headers['Authorization'] = 'Basic ' . base64_encode($authData['username']. ':' . $authData['password'] );
}
......
......@@ -138,5 +138,4 @@ class Events
* @var string
*/
const POST_CREATE_QUERY = 'solarium.core.postCreateQuery';
}
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\Core\Event;
use Symfony\Component\EventDispatcher\Event;
use Solarium\Core\Query\QueryInterface;
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\Query\Component;
use Solarium\QueryType\Select\Query\Query as SelectQuery;
use Solarium\QueryType\Select\RequestBuilder\Component\MoreLikeThis as RequestBuilder;
use Solarium\QueryType\Select\ResponseParser\Component\MoreLikeThis as ResponseParser;
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Select\ResponseParser\Component;
use Solarium\QueryType\Select\Query\Query;
use Solarium\QueryType\Select\Query\Component\Spellcheck as SpellcheckComponent;
use Solarium\QueryType\Select\Result\Spellcheck as SpellcheckResult;
......@@ -119,7 +120,7 @@ class Spellcheck extends ResponseParserAbstract implements ComponentParserInterf
} else {
if ($queryObject->getResponseWriter() == $queryObject::WT_JSON) {
if (is_array(current($values))){
if (is_array(current($values))) {
foreach($values as $key => $value) {
$values[$key] = $this->convertToKeyValueArray($value);
}
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Update\Query\Command;
use Solarium\QueryType\Update\Query\Query as UpdateQuery;
use Solarium\QueryType\Update\Query\Document\DocumentInterface;
use Solarium\Exception\RuntimeException;
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Update\Query\Command;
use Solarium\QueryType\Update\Query\Query as UpdateQuery;
/**
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Update\Query\Command;
use Solarium\QueryType\Update\Query\Query as UpdateQuery;
/**
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Update\Query\Command;
use Solarium\QueryType\Update\Query\Query as UpdateQuery;
/**
......
......@@ -369,7 +369,7 @@ class Document extends AbstractDocument implements DocumentInterface
*/
public function setFieldModifier($key, $modifier = null)
{
if (! in_array($modifier, array(self::MODIFIER_ADD, self::MODIFIER_INC, self::MODIFIER_SET)) ) {
if (!in_array($modifier, array(self::MODIFIER_ADD, self::MODIFIER_INC, self::MODIFIER_SET))) {
throw new RuntimeException('Attempt to set an atomic update modifier that is not supported');
}
$this->modifiers[$key] = $modifier;
......
......@@ -37,6 +37,7 @@
* @namespace
*/
namespace Solarium\QueryType\Update\Query;
use Solarium\Core\Client\Client;
use Solarium\Core\Query\Query as BaseQuery;
use Solarium\QueryType\Update\RequestBuilder;
......
......@@ -169,7 +169,7 @@ class RequestBuilder extends BaseRequestBuilder
$xml = '<field name="' . $name . '"';
$xml .= $this->attrib('boost', $boost);
$xml .= $this->attrib('update', $modifier);
if ($value === null){
if ($value === null) {
$xml .= $this->attrib('null', 'true');
}
$xml .= '>' . htmlspecialchars($value, ENT_NOQUOTES, 'UTF-8');
......@@ -226,7 +226,7 @@ class RequestBuilder extends BaseRequestBuilder
$xml = '<commit';
$xml .= $this->boolAttrib('softCommit', $command->getSoftCommit());
$xml .= $this->boolAttrib('waitSearcher', $command->getWaitSearcher());
$xml .= $this->boolAttrib('expungeDeletes',$command->getExpungeDeletes());
$xml .= $this->boolAttrib('expungeDeletes', $command->getExpungeDeletes());
$xml .= '/>';
return $xml;
......
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