Commit e670e432 authored by Gabriel Caruso's avatar Gabriel Caruso

Simplify returns

parent 1faeb780
......@@ -30,11 +30,7 @@ class Connection extends \Doctrine\DBAL\Driver\PDOConnection
public function quote($value, $type = \PDO::PARAM_STR)
{
if (\PDO::PARAM_BOOL === $type) {
if ($value) {
return 'true';
}
return 'false';
return $value ? 'true' : 'false';
}
return parent::quote($value, $type);
......
......@@ -654,11 +654,7 @@ class SQLServerPlatform extends AbstractPlatform
// We need to drop an existing default constraint if the column was
// defined with a default value before and the native column type has changed.
if ($columnDiff->hasChanged('type') || $columnDiff->hasChanged('fixed')) {
return true;
}
return false;
return $columnDiff->hasChanged('type') || $columnDiff->hasChanged('fixed');
}
/**
......@@ -1320,11 +1316,7 @@ class SQLServerPlatform extends AbstractPlatform
$currentPosition--;
}
if (preg_match('/SELECT\s+(DISTINCT\s+)?TOP\s/i', $subQueryBuffer)) {
return true;
}
return false;
return (bool) preg_match('/SELECT\s+(DISTINCT\s+)?TOP\s/i', $subQueryBuffer);
}
/**
......
......@@ -184,11 +184,7 @@ class Comparator
return true;
}
if ($sequence1->getInitialValue() != $sequence2->getInitialValue()) {
return true;
}
return false;
return $sequence1->getInitialValue() != $sequence2->getInitialValue();
}
/**
......@@ -406,11 +402,7 @@ class Comparator
return true;
}
if ($key1->onDelete() != $key2->onDelete()) {
return true;
}
return false;
return $key1->onDelete() != $key2->onDelete();
}
/**
......@@ -534,10 +526,6 @@ class Comparator
*/
public function diffIndex(Index $index1, Index $index2)
{
if ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1)) {
return false;
}
return true;
return ! ($index1->isFullfilledBy($index2) && $index2->isFullfilledBy($index1));
}
}
......@@ -226,11 +226,7 @@ class Index extends AbstractAsset implements Constraint
return false;
}
if ($other->isUnique() != $this->isUnique()) {
return false;
}
return true;
return $other->isUnique() == $this->isUnique();
}
return false;
......@@ -251,11 +247,7 @@ class Index extends AbstractAsset implements Constraint
return false;
}
if ($this->spansColumns($other->getColumns()) && ($this->isPrimary() || $this->isUnique()) && $this->samePartialIndex($other)) {
return true;
}
return false;
return $this->spansColumns($other->getColumns()) && ($this->isPrimary() || $this->isUnique()) && $this->samePartialIndex($other);
}
/**
......@@ -348,11 +340,7 @@ class Index extends AbstractAsset implements Constraint
return true;
}
if ( ! $this->hasOption('where') && ! $other->hasOption('where')) {
return true;
}
return false;
return ! $this->hasOption('where') && ! $other->hasOption('where');
}
}
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