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