Commit 94f80b91 authored by Steve Müller's avatar Steve Müller

fix CS

parent 6942a202
...@@ -1166,7 +1166,7 @@ abstract class AbstractPlatform ...@@ -1166,7 +1166,7 @@ abstract class AbstractPlatform
/* @var $index Index */ /* @var $index Index */
if ($index->isPrimary()) { if ($index->isPrimary()) {
$platform = $this; $platform = $this;
$options['primary'] = $index->getQuotedColumns($this); $options['primary'] = $index->getQuotedColumns($this);
$options['primary_index'] = $index; $options['primary_index'] = $index;
} else { } else {
$options['indexes'][$index->getName()] = $index; $options['indexes'][$index->getName()] = $index;
......
...@@ -74,13 +74,16 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint ...@@ -74,13 +74,16 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
public function __construct(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name = null, array $options = array()) public function __construct(array $localColumnNames, $foreignTableName, array $foreignColumnNames, $name = null, array $options = array())
{ {
$this->_setName($name); $this->_setName($name);
$this->_localColumnNames = $localColumnNames ? array_combine($localColumnNames, array_map(function($column) { $identifierConstructorCallback = function ($column) {
return new Identifier($column); return new Identifier($column);
}, $localColumnNames)) : array(); };
$this->_localColumnNames = $localColumnNames
? array_combine($localColumnNames, array_map($identifierConstructorCallback, $localColumnNames))
: array();
$this->_foreignTableName = new Identifier($foreignTableName); $this->_foreignTableName = new Identifier($foreignTableName);
$this->_foreignColumnNames = $foreignColumnNames ? array_combine($foreignColumnNames, array_map(function($column) { $this->_foreignColumnNames = $foreignColumnNames
return new Identifier($column); ? array_combine($foreignColumnNames, array_map($identifierConstructorCallback, $foreignColumnNames))
}, $foreignColumnNames)) : array(); : array();
$this->_options = $options; $this->_options = $options;
} }
......
...@@ -158,14 +158,16 @@ class Index extends AbstractAsset implements Constraint ...@@ -158,14 +158,16 @@ class Index extends AbstractAsset implements Constraint
*/ */
public function spansColumns(array $columnNames) public function spansColumns(array $columnNames)
{ {
$columns = $this->getColumns(); $columns = $this->getColumns();
$numberOfColumns = count($columns); $numberOfColumns = count($columns);
$sameColumns = true; $sameColumns = true;
for ($i = 0; $i < $numberOfColumns; $i++) { for ($i = 0; $i < $numberOfColumns; $i++) {
if (!isset($columnNames[$i]) || $this->trimQuotes(strtolower($columns[$i])) !== $this->trimQuotes(strtolower($columnNames[$i]))) { if ( ! isset($columnNames[$i]) || $this->trimQuotes(strtolower($columns[$i])) !== $this->trimQuotes(strtolower($columnNames[$i]))) {
$sameColumns = false; $sameColumns = false;
} }
} }
return $sameColumns; return $sameColumns;
} }
......
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