Commit 5730a32d authored by romanb's avatar romanb

[2.0] Fixed more STRICT standards notices (only variables should be passed by...

[2.0] Fixed more STRICT standards notices (only variables should be passed by reference...). @beberlei, error_reporting=E_ALL | E_STRICT
parent 1013eb66
...@@ -132,14 +132,16 @@ class DatabaseDriver implements Driver ...@@ -132,14 +132,16 @@ class DatabaseDriver implements Driver
"Cannot generate mapping for table '".$tableName."' with foreign keys with multiple local columns." "Cannot generate mapping for table '".$tableName."' with foreign keys with multiple local columns."
); );
} }
$localColumn = current($foreignKey->getColumns()); $cols = $foreignKey->getColumns();
$localColumn = current($cols);
if (count($foreignKey->getForeignColumns()) != 1) { $fkCols = $foreignKey->getForeignColumns();
if (count($fkCols) != 1) {
throw new MappingException( throw new MappingException(
"Cannot generate mapping for table '".$tableName."' with foreign keys with multiple foreign columns." "Cannot generate mapping for table '".$tableName."' with foreign keys with multiple foreign columns."
); );
} }
$foreignColumn = current($foreignKey->getForeignColumns()); $foreignColumn = current($fkCols);
$associationMapping = array(); $associationMapping = array();
$associationMapping['fieldName'] = Inflector::camelize(str_ireplace('_id', '', $localColumn)); $associationMapping['fieldName'] = Inflector::camelize(str_ireplace('_id', '', $localColumn));
......
...@@ -346,7 +346,8 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest ...@@ -346,7 +346,8 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertFalse($table->hasIndex('foo_idx')); $this->assertFalse($table->hasIndex('foo_idx'));
$this->assertEquals(1, count($table->getForeignKeys())); $this->assertEquals(1, count($table->getForeignKeys()));
$foreignKey = current($table->getForeignKeys()); $fks = $table->getForeignKeys();
$foreignKey = current($fks);
$this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName())); $this->assertEquals('alter_table_foreign', strtolower($foreignKey->getForeignTableName()));
$this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns())); $this->assertEquals(array('foreign_key_test'), array_map('strtolower', $foreignKey->getColumns()));
$this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns())); $this->assertEquals(array('id'), array_map('strtolower', $foreignKey->getForeignColumns()));
......
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