Commit a8019c65 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fix CS: Apply unused local variable changes by @hhamon - Fixes GH-91

parent 8c9e9e81
...@@ -1164,7 +1164,7 @@ class Connection implements DriverConnection ...@@ -1164,7 +1164,7 @@ class Connection implements DriverConnection
// Positional parameters // Positional parameters
$typeOffset = array_key_exists(0, $types) ? -1 : 0; $typeOffset = array_key_exists(0, $types) ? -1 : 0;
$bindIndex = 1; $bindIndex = 1;
foreach ($params as $position => $value) { foreach ($params as $value) {
$typeIndex = $bindIndex + $typeOffset; $typeIndex = $bindIndex + $typeOffset;
if (isset($types[$typeIndex])) { if (isset($types[$typeIndex])) {
$type = $types[$typeIndex]; $type = $types[$typeIndex];
......
...@@ -358,7 +358,7 @@ class DB2Platform extends AbstractPlatform ...@@ -358,7 +358,7 @@ class DB2Platform extends AbstractPlatform
$sqls = parent::_getCreateTableSQL($tableName, $columns, $options); $sqls = parent::_getCreateTableSQL($tableName, $columns, $options);
foreach ($indexes as $index => $definition) { foreach ($indexes as $definition) {
$sqls[] = $this->getCreateIndexSQL($definition, $tableName); $sqls[] = $this->getCreateIndexSQL($definition, $tableName);
} }
return $sqls; return $sqls;
...@@ -376,7 +376,7 @@ class DB2Platform extends AbstractPlatform ...@@ -376,7 +376,7 @@ class DB2Platform extends AbstractPlatform
$columnSql = array(); $columnSql = array();
$queryParts = array(); $queryParts = array();
foreach ($diff->addedColumns as $fieldName => $column) { foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue; continue;
} }
......
...@@ -460,7 +460,7 @@ class MySqlPlatform extends AbstractPlatform ...@@ -460,7 +460,7 @@ class MySqlPlatform extends AbstractPlatform
$queryParts[] = 'RENAME TO ' . $diff->newName; $queryParts[] = 'RENAME TO ' . $diff->newName;
} }
foreach ($diff->addedColumns as $fieldName => $column) { foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue; continue;
} }
......
...@@ -354,7 +354,7 @@ class OraclePlatform extends AbstractPlatform ...@@ -354,7 +354,7 @@ class OraclePlatform extends AbstractPlatform
} }
if (isset($indexes) && ! empty($indexes)) { if (isset($indexes) && ! empty($indexes)) {
foreach ($indexes as $indexName => $index) { foreach ($indexes as $index) {
$sql[] = $this->getCreateIndexSQL($index, $table); $sql[] = $this->getCreateIndexSQL($index, $table);
} }
} }
...@@ -408,10 +408,6 @@ class OraclePlatform extends AbstractPlatform ...@@ -408,10 +408,6 @@ class OraclePlatform extends AbstractPlatform
$sql = array(); $sql = array();
$indexName = $table . '_AI_PK'; $indexName = $table . '_AI_PK';
$definition = array(
'primary' => true,
'columns' => array($name => true),
);
$idx = new \Doctrine\DBAL\Schema\Index($indexName, array($name), true, true); $idx = new \Doctrine\DBAL\Schema\Index($indexName, array($name), true, true);
......
...@@ -153,7 +153,6 @@ class SQLServerPlatform extends AbstractPlatform ...@@ -153,7 +153,6 @@ class SQLServerPlatform extends AbstractPlatform
public function getDropIndexSQL($index, $table=null) public function getDropIndexSQL($index, $table=null)
{ {
if ($index instanceof \Doctrine\DBAL\Schema\Index) { if ($index instanceof \Doctrine\DBAL\Schema\Index) {
$index_ = $index;
$index = $index->getQuotedName($this); $index = $index->getQuotedName($this);
} else if (!is_string($index)) { } else if (!is_string($index)) {
throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.');
...@@ -322,7 +321,7 @@ class SQLServerPlatform extends AbstractPlatform ...@@ -322,7 +321,7 @@ class SQLServerPlatform extends AbstractPlatform
$queryParts[] = 'RENAME TO ' . $diff->newName; $queryParts[] = 'RENAME TO ' . $diff->newName;
} }
foreach ($diff->addedColumns as $fieldName => $column) { foreach ($diff->addedColumns as $column) {
if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) { if ($this->onSchemaAlterTableAddColumn($column, $diff, $columnSql)) {
continue; continue;
} }
......
...@@ -576,7 +576,7 @@ abstract class AbstractSchemaManager ...@@ -576,7 +576,7 @@ abstract class AbstractSchemaManager
protected function _getPortableDatabasesList($databases) protected function _getPortableDatabasesList($databases)
{ {
$list = array(); $list = array();
foreach ($databases as $key => $value) { foreach ($databases as $value) {
if ($value = $this->_getPortableDatabaseDefinition($value)) { if ($value = $this->_getPortableDatabaseDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -592,7 +592,7 @@ abstract class AbstractSchemaManager ...@@ -592,7 +592,7 @@ abstract class AbstractSchemaManager
protected function _getPortableFunctionsList($functions) protected function _getPortableFunctionsList($functions)
{ {
$list = array(); $list = array();
foreach ($functions as $key => $value) { foreach ($functions as $value) {
if ($value = $this->_getPortableFunctionDefinition($value)) { if ($value = $this->_getPortableFunctionDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -608,7 +608,7 @@ abstract class AbstractSchemaManager ...@@ -608,7 +608,7 @@ abstract class AbstractSchemaManager
protected function _getPortableTriggersList($triggers) protected function _getPortableTriggersList($triggers)
{ {
$list = array(); $list = array();
foreach ($triggers as $key => $value) { foreach ($triggers as $value) {
if ($value = $this->_getPortableTriggerDefinition($value)) { if ($value = $this->_getPortableTriggerDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -624,7 +624,7 @@ abstract class AbstractSchemaManager ...@@ -624,7 +624,7 @@ abstract class AbstractSchemaManager
protected function _getPortableSequencesList($sequences) protected function _getPortableSequencesList($sequences)
{ {
$list = array(); $list = array();
foreach ($sequences as $key => $value) { foreach ($sequences as $value) {
if ($value = $this->_getPortableSequenceDefinition($value)) { if ($value = $this->_getPortableSequenceDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -656,7 +656,7 @@ abstract class AbstractSchemaManager ...@@ -656,7 +656,7 @@ abstract class AbstractSchemaManager
$eventManager = $this->_platform->getEventManager(); $eventManager = $this->_platform->getEventManager();
$list = array(); $list = array();
foreach ($tableColumns as $key => $tableColumn) { foreach ($tableColumns as $tableColumn) {
$column = null; $column = null;
$defaultPrevented = false; $defaultPrevented = false;
...@@ -748,7 +748,7 @@ abstract class AbstractSchemaManager ...@@ -748,7 +748,7 @@ abstract class AbstractSchemaManager
protected function _getPortableTablesList($tables) protected function _getPortableTablesList($tables)
{ {
$list = array(); $list = array();
foreach ($tables as $key => $value) { foreach ($tables as $value) {
if ($value = $this->_getPortableTableDefinition($value)) { if ($value = $this->_getPortableTableDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -764,7 +764,7 @@ abstract class AbstractSchemaManager ...@@ -764,7 +764,7 @@ abstract class AbstractSchemaManager
protected function _getPortableUsersList($users) protected function _getPortableUsersList($users)
{ {
$list = array(); $list = array();
foreach ($users as $key => $value) { foreach ($users as $value) {
if ($value = $this->_getPortableUserDefinition($value)) { if ($value = $this->_getPortableUserDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
...@@ -780,7 +780,7 @@ abstract class AbstractSchemaManager ...@@ -780,7 +780,7 @@ abstract class AbstractSchemaManager
protected function _getPortableViewsList($views) protected function _getPortableViewsList($views)
{ {
$list = array(); $list = array();
foreach ($views as $key => $value) { foreach ($views as $value) {
if ($view = $this->_getPortableViewDefinition($value)) { if ($view = $this->_getPortableViewDefinition($value)) {
$viewName = strtolower($view->getQuotedName($this->_platform)); $viewName = strtolower($view->getQuotedName($this->_platform));
$list[$viewName] = $view; $list[$viewName] = $view;
...@@ -797,7 +797,7 @@ abstract class AbstractSchemaManager ...@@ -797,7 +797,7 @@ abstract class AbstractSchemaManager
protected function _getPortableTableForeignKeysList($tableForeignKeys) protected function _getPortableTableForeignKeysList($tableForeignKeys)
{ {
$list = array(); $list = array();
foreach ($tableForeignKeys as $key => $value) { foreach ($tableForeignKeys as $value) {
if ($value = $this->_getPortableTableForeignKeyDefinition($value)) { if ($value = $this->_getPortableTableForeignKeyDefinition($value)) {
$list[] = $value; $list[] = $value;
} }
......
...@@ -261,7 +261,7 @@ class Comparator ...@@ -261,7 +261,7 @@ class Comparator
} }
} }
foreach ($renameCandidates as $candidate => $candidateColumns) { foreach ($renameCandidates as $candidateColumns) {
if (count($candidateColumns) == 1) { if (count($candidateColumns) == 1) {
list($removedColumn, $addedColumn) = $candidateColumns[0]; list($removedColumn, $addedColumn) = $candidateColumns[0];
$removedColumnName = strtolower($removedColumn->getName()); $removedColumnName = strtolower($removedColumn->getName());
......
...@@ -124,7 +124,6 @@ class DB2SchemaManager extends AbstractSchemaManager ...@@ -124,7 +124,6 @@ class DB2SchemaManager extends AbstractSchemaManager
{ {
$eventManager = $this->_platform->getEventManager(); $eventManager = $this->_platform->getEventManager();
$tableIndexRows = array();
$indexes = array(); $indexes = array();
foreach($tableIndexes as $indexKey => $data) { foreach($tableIndexes as $indexKey => $data) {
$data = array_change_key_case($data, \CASE_LOWER); $data = array_change_key_case($data, \CASE_LOWER);
......
...@@ -146,17 +146,11 @@ class MySqlSchemaManager extends AbstractSchemaManager ...@@ -146,17 +146,11 @@ class MySqlSchemaManager extends AbstractSchemaManager
} }
$length = ((int) $length == 0) ? null : (int) $length; $length = ((int) $length == 0) ? null : (int) $length;
$def = array(
'type' => $type,
'length' => $length,
'unsigned' => (bool) $unsigned,
'fixed' => (bool) $fixed
);
$options = array( $options = array(
'length' => $length, 'length' => $length,
'unsigned' => (bool)$unsigned, 'unsigned' => (bool) $unsigned,
'fixed' => (bool)$fixed, 'fixed' => (bool) $fixed,
'default' => isset($tableColumn['default']) ? $tableColumn['default'] : null, 'default' => isset($tableColumn['default']) ? $tableColumn['default'] : null,
'notnull' => (bool) ($tableColumn['null'] != 'YES'), 'notnull' => (bool) ($tableColumn['null'] != 'YES'),
'scale' => null, 'scale' => null,
......
...@@ -199,7 +199,7 @@ class OracleSchemaManager extends AbstractSchemaManager ...@@ -199,7 +199,7 @@ class OracleSchemaManager extends AbstractSchemaManager
protected function _getPortableTableForeignKeysList($tableForeignKeys) protected function _getPortableTableForeignKeysList($tableForeignKeys)
{ {
$list = array(); $list = array();
foreach ($tableForeignKeys as $key => $value) { foreach ($tableForeignKeys as $value) {
$value = \array_change_key_case($value, CASE_LOWER); $value = \array_change_key_case($value, CASE_LOWER);
if (!isset($list[$value['constraint_name']])) { if (!isset($list[$value['constraint_name']])) {
if ($value['delete_rule'] == "NO ACTION") { if ($value['delete_rule'] == "NO ACTION") {
......
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