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

fix CS

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