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

fix CS

parent 6942a202
......@@ -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;
}
......
......@@ -161,11 +161,13 @@ class Index extends AbstractAsset implements Constraint
$columns = $this->getColumns();
$numberOfColumns = count($columns);
$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