Commit 9e7c1dc2 authored by Gabriel Caruso's avatar Gabriel Caruso

Combine consecutives unsets

parent 0a7eadb9
......@@ -288,8 +288,7 @@ class MasterSlaveConnection extends Connection
*/
public function close()
{
unset($this->connections['master']);
unset($this->connections['slave']);
unset($this->connections['master'], $this->connections['slave']);
parent::close();
......
......@@ -698,8 +698,7 @@ class DB2Platform extends AbstractPlatform
$sql[] = $this->getCreateIndexSQL($addIndex, $table);
unset($diff->removedIndexes[$remKey]);
unset($diff->addedIndexes[$addKey]);
unset($diff->removedIndexes[$remKey], $diff->addedIndexes[$addKey]);
break;
}
......
......@@ -660,8 +660,7 @@ class MySqlPlatform extends AbstractPlatform
$sql[] = $query;
unset($diff->removedIndexes[$remKey]);
unset($diff->addedIndexes[$addKey]);
unset($diff->removedIndexes[$remKey], $diff->addedIndexes[$addKey]);
break;
}
......
......@@ -818,9 +818,11 @@ class SqlitePlatform extends AbstractPlatform
$columnName = strtolower($columnName);
if (isset($columns[$columnName])) {
unset($columns[$columnName]);
unset($oldColumnNames[$columnName]);
unset($newColumnNames[$columnName]);
unset(
$columns[$columnName],
$oldColumnNames[$columnName],
$newColumnNames[$columnName]
);
}
}
......
......@@ -279,14 +279,12 @@ class Comparator
foreach ($fromFkeys as $key1 => $constraint1) {
foreach ($toFkeys as $key2 => $constraint2) {
if ($this->diffForeignKey($constraint1, $constraint2) === false) {
unset($fromFkeys[$key1]);
unset($toFkeys[$key2]);
unset($fromFkeys[$key1], $toFkeys[$key2]);
} else {
if (strtolower($constraint1->getName()) == strtolower($constraint2->getName())) {
$tableDifferences->changedForeignKeys[] = $constraint2;
$changes++;
unset($fromFkeys[$key1]);
unset($toFkeys[$key2]);
unset($fromFkeys[$key1], $toFkeys[$key2]);
}
}
}
......@@ -332,8 +330,10 @@ class Comparator
if ( ! isset($tableDifferences->renamedColumns[$removedColumnName])) {
$tableDifferences->renamedColumns[$removedColumnName] = $addedColumn;
unset($tableDifferences->addedColumns[$addedColumnName]);
unset($tableDifferences->removedColumns[$removedColumnName]);
unset(
$tableDifferences->addedColumns[$addedColumnName],
$tableDifferences->removedColumns[$removedColumnName]
);
}
}
}
......@@ -373,8 +373,10 @@ class Comparator
if (! isset($tableDifferences->renamedIndexes[$removedIndexName])) {
$tableDifferences->renamedIndexes[$removedIndexName] = $addedIndex;
unset($tableDifferences->addedIndexes[$addedIndexName]);
unset($tableDifferences->removedIndexes[$removedIndexName]);
unset(
$tableDifferences->addedIndexes[$addedIndexName],
$tableDifferences->removedIndexes[$removedIndexName]
);
}
}
}
......
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