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