Commit d6104fc7 authored by Bas de Nooijer's avatar Bas de Nooijer

Strict compare of boolean values

parent 4f4fe388
......@@ -243,7 +243,7 @@ class Client extends Configurable
if ($endpoint->getKey() !== null) {
$this->addEndpoint($endpoint);
if ($setAsDefault == true) {
if ($setAsDefault === true) {
$this->setDefaultEndpoint($endpoint);
}
}
......
......@@ -108,7 +108,7 @@ class Configurable implements ConfigurableInterface
}
}
if (true == $overwrite) {
if (true === $overwrite) {
$this->options = $options;
} else {
$this->options = array_merge($this->options, $options);
......
......@@ -118,7 +118,7 @@ abstract class AbstractRequestBuilder implements RequestBuilderInterface
public function boolAttrib($name, $value)
{
if (null !== $value) {
$value = (true == $value) ? 'true' : 'false';
$value = (true === (bool)$value) ? 'true' : 'false';
return $this->attrib($name, $value);
} else {
......
......@@ -469,7 +469,7 @@ class Loadbalancer extends AbstractPlugin
$this->endpointExcludes = array(); // reset for each query
$adapter = $this->client->getAdapter();
if ($this->getFailoverEnabled() == true) {
if ($this->getFailoverEnabled() === true) {
$maxRetries = $this->getFailoverMaxRetries();
for ($i = 0; $i <= $maxRetries; $i++) {
$endpoint = $this->getRandomEndpoint();
......
......@@ -80,7 +80,7 @@ class RequestBuilder extends BaseRequestBuilder
}
// add document settings to request
if (($doc = $query->getDocument()) != null) {
if (($doc = $query->getDocument()) !== null) {
if ($doc->getBoost() !== null) {
throw new RuntimeException('Extract does not support document-level boosts, use field boosts instead.');
}
......
......@@ -71,7 +71,7 @@ class ResponseParser extends SelectResponseParser
$parseResult['interestingTerms'] = $terms;
}
if (isset($data['match']['docs'][0]) && true == $query->getMatchInclude()) {
if (isset($data['match']['docs'][0]) && true === $query->getMatchInclude()) {
$matchData = $data['match']['docs'][0];
$documentClass = $query->getOption('documentclass');
......
......@@ -119,7 +119,7 @@ class Result extends SelectResult
public function getMatch()
{
$query = $this->getQuery();
if (true != $query->getMatchInclude()) {
if (true !== $query->getMatchInclude()) {
throw new UnexpectedValueException('matchinclude was disabled in the MLT query');
}
$this->parseResponse();
......
......@@ -792,7 +792,7 @@ class Query extends BaseQuery
if (isset($this->components[$key])) {
return $this->components[$key];
} else {
if ($autoload == true) {
if ($autoload === true) {
if (!isset($this->componentTypes[$key])) {
throw new OutOfBoundsException('Cannot autoload unknown component: '.$key);
}
......
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