Commit a7a8f31a authored by jeroendedauw's avatar jeroendedauw

foreach AS -> foreach as

parent 3065aff5
......@@ -20,7 +20,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer', array());
$table->setPrimaryKey(array('id'));
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -46,10 +46,10 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->setPrimaryKey(array('id'));
$this->setExpectedException('\Doctrine\DBAL\Exception\TableExistsException');
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
}
......@@ -72,7 +72,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$owningTable->setPrimaryKey(array('id'));
$owningTable->addForeignKeyConstraint($table, array('constraint_id'), array('id'));
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -92,7 +92,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('value', 'integer', array('notnull' => true));
$table->setPrimaryKey(array('id'));
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -107,7 +107,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table = $schema->createTable("bad_fieldname_table");
$table->addColumn('id', 'integer', array());
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -125,7 +125,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table2 = $schema->createTable("ambiguous_list_table_2");
$table2->addColumn('id', 'integer');
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -142,7 +142,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer');
$table->addUniqueIndex(array('id'));
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($this->_conn->getDatabasePlatform()) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -157,7 +157,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer', array());
$table->setPrimaryKey(array('id'));
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -195,7 +195,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('id', 'integer');
$this->setExpectedException($exceptionClass);
foreach ($schema->toSql($conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->executeQuery($sql);
}
}
......@@ -236,7 +236,7 @@ class ExceptionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$this->setExpectedException('Doctrine\DBAL\Exception\ConnectionException');
foreach ($schema->toSql($conn->getDatabasePlatform()) AS $sql) {
foreach ($schema->toSql($conn->getDatabasePlatform()) as $sql) {
$conn->executeQuery($sql);
}
}
......
......@@ -116,7 +116,7 @@ class ModifyLimitQueryTest extends \Doctrine\Tests\DbalFunctionalTestCase
{
$p = $this->_conn->getDatabasePlatform();
$data = array();
foreach ($this->_conn->fetchAll($p->modifyLimitQuery($sql, $limit, $offset)) AS $row) {
foreach ($this->_conn->fetchAll($p->modifyLimitQuery($sql, $limit, $offset)) as $row) {
$row = array_change_key_case($row, CASE_LOWER);
$data[] = $row['test_int'];
}
......
......@@ -109,7 +109,7 @@ class PortabilityTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function assertFetchResultRows($rows)
{
$this->assertEquals(2, count($rows));
foreach ($rows AS $row) {
foreach ($rows as $row) {
$this->assertFetchResultRow($row);
}
}
......
......@@ -31,7 +31,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
}
$this->_conn->executeUpdate('DELETE FROM caching');
foreach ($this->expectedResult AS $row) {
foreach ($this->expectedResult as $row) {
$this->_conn->insert('caching', $row);
}
......@@ -50,7 +50,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testFetchNum()
{
$expectedResult = array();
foreach ($this->expectedResult AS $v) {
foreach ($this->expectedResult as $v) {
$expectedResult[] = array_values($v);
}
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_NUM);
......@@ -59,7 +59,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testFetchBoth()
{
$expectedResult = array();
foreach ($this->expectedResult AS $v) {
foreach ($this->expectedResult as $v) {
$expectedResult[] = array_merge($v, array_values($v));
}
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_BOTH);
......@@ -68,7 +68,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testFetchColumn()
{
$expectedResult = array();
foreach ($this->expectedResult AS $v) {
foreach ($this->expectedResult as $v) {
$expectedResult[] = array_shift($v);
}
$this->assertCacheNonCacheSelectSameFetchModeAreEqual($expectedResult, \PDO::FETCH_COLUMN);
......@@ -77,7 +77,7 @@ class ResultCacheTest extends \Doctrine\Tests\DbalFunctionalTestCase
public function testMixingFetch()
{
$numExpectedResult = array();
foreach ($this->expectedResult AS $v) {
foreach ($this->expectedResult as $v) {
$numExpectedResult[] = array_values($v);
}
$stmt = $this->_conn->executeQuery("SELECT * FROM caching ORDER BY test_int ASC", array(), array(), new QueryCacheProfile(10, "testcachekey"));
......
......@@ -69,7 +69,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertInternalType('array', $sequences, 'listSequences() should return an array.');
$foundSequence = null;
foreach($sequences AS $sequence) {
foreach($sequences as $sequence) {
$this->assertInstanceOf('Doctrine\DBAL\Schema\Sequence', $sequence, 'Array elements of listSequences() should be Sequence instances.');
if(strtolower($sequence->getName()) == 'list_sequences_test_seq') {
$foundSequence = $sequence;
......@@ -104,7 +104,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertTrue(count($tables) > 0, "List Tables has to find at least one table named 'list_tables_test'.");
$foundTable = false;
foreach ($tables AS $table) {
foreach ($tables as $table) {
$this->assertInstanceOf('Doctrine\DBAL\Schema\Table', $table);
if (strtolower($table->getName()) == 'list_tables_test') {
$foundTable = true;
......@@ -722,7 +722,7 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
protected function assertHasTable($tables, $tableName)
{
$foundTable = false;
foreach ($tables AS $table) {
foreach ($tables as $table) {
$this->assertInstanceOf('Doctrine\DBAL\Schema\Table', $table, 'No Table instance was found in tables array.');
if (strtolower($table->getName()) == 'list_tables_test_new_name') {
$foundTable = true;
......
......@@ -50,7 +50,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn("id", "integer");
$table->setPrimaryKey(array('id'));
foreach ($platform->getCreateTableSQL($table) AS $sql) {
foreach ($platform->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
......@@ -87,7 +87,7 @@ class TemporaryTableTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn("id", "integer");
$table->setPrimaryKey(array('id'));
foreach ($platform->getCreateTableSQL($table) AS $sql) {
foreach ($platform->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
......
......@@ -36,7 +36,7 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->setPrimaryKey(array('id'));
try {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
} catch(\Exception $e) {
......
......@@ -18,7 +18,7 @@ class WriteTest extends \Doctrine\Tests\DbalFunctionalTestCase
$table->addColumn('test_string', 'string', array('notnull' => false));
$table->setPrimaryKey(array('id'));
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) AS $sql) {
foreach ($this->_conn->getDatabasePlatform()->getCreateTableSQL($table) as $sql) {
$this->_conn->executeQuery($sql);
}
} catch(\Exception $e) {
......
......@@ -55,7 +55,7 @@ class MySQLSchemaTest extends \PHPUnit_Framework_TestCase
$tableOld->addUnnamedForeignKeyConstraint('test_foreign', array('foo_id'), array('foo_id'));
$sqls = array();
foreach ($tableOld->getForeignKeys() AS $fk) {
foreach ($tableOld->getForeignKeys() as $fk) {
$sqls[] = $this->platform->getCreateForeignKeySQL($fk, $tableOld);
}
......
......@@ -49,7 +49,7 @@ class DbalFunctionalTestCase extends DbalTestCase
if(isset($this->_sqlLoggerStack->queries) && count($this->_sqlLoggerStack->queries)) {
$queries = "";
$i = count($this->_sqlLoggerStack->queries);
foreach (array_reverse($this->_sqlLoggerStack->queries) AS $query) {
foreach (array_reverse($this->_sqlLoggerStack->queries) as $query) {
$params = array_map(function($p) { if (is_object($p)) return get_class($p); else return "'".$p."'"; }, $query['params'] ?: array());
$queries .= ($i+1).". SQL: '".$query['sql']."' Params: ".implode(", ", $params).PHP_EOL;
$i--;
......@@ -57,7 +57,7 @@ class DbalFunctionalTestCase extends DbalTestCase
$trace = $e->getTrace();
$traceMsg = "";
foreach($trace AS $part) {
foreach($trace as $part) {
if(isset($part['file'])) {
if(strpos($part['file'], "PHPUnit/") !== false) {
// Beginning with PHPUnit files we don't print the trace anymore.
......
......@@ -60,7 +60,7 @@ class TestUtil
$schema = $sm->createSchema();
$stmts = $schema->toDropSql($realConn->getDatabasePlatform());
foreach ($stmts AS $stmt) {
foreach ($stmts as $stmt) {
$realConn->exec($stmt);
}
}
......@@ -80,7 +80,7 @@ class TestUtil
if (isset($GLOBALS['db_event_subscribers'])) {
$evm = $conn->getEventManager();
foreach (explode(",", $GLOBALS['db_event_subscribers']) AS $subscriberClass) {
foreach (explode(",", $GLOBALS['db_event_subscribers']) as $subscriberClass) {
$subscriberInstance = new $subscriberClass();
$evm->addEventSubscriber($subscriberInstance);
}
......
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