Foreach overwrites $variable with its value variable.

parent e17fcab8
......@@ -325,8 +325,8 @@ class SqlitePlatform extends AbstractPlatform
$queryFields = $this->getColumnDeclarationListSQL($columns);
if (isset($options['uniqueConstraints']) && ! empty($options['uniqueConstraints'])) {
foreach ($options['uniqueConstraints'] as $name => $definition) {
$queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($name, $definition);
foreach ($options['uniqueConstraints'] as $constraintName => $definition) {
$queryFields .= ', ' . $this->getUniqueConstraintDeclarationSQL($constraintName, $definition);
}
}
......
......@@ -119,11 +119,7 @@ class CompositeExpression implements Countable
{
$that = clone $this;
$that->parts[] = $part;
foreach ($parts as $part) {
$that->parts[] = $part;
}
$that->parts = array_merge($that->parts, [$part], $parts);
return $that;
}
......
......@@ -171,26 +171,24 @@ abstract class SchemaManagerFunctionalTestCase extends FunctionalTestCase
);
}
$sequence = new Sequence('list_sequences_test_seq', 20, 10);
$this->schemaManager->createSequence($sequence);
$this->schemaManager->createSequence(
new Sequence('list_sequences_test_seq', 20, 10)
);
$sequences = $this->schemaManager->listSequences();
self::assertIsArray($sequences, 'listSequences() should return an array.');
$foundSequence = null;
foreach ($sequences as $sequence) {
self::assertInstanceOf(Sequence::class, $sequence, 'Array elements of listSequences() should be Sequence instances.');
if (strtolower($sequence->getName()) !== 'list_sequences_test_seq') {
continue;
}
if (strtolower($sequence->getName()) === 'list_sequences_test_seq') {
self::assertSame(20, $sequence->getAllocationSize());
self::assertSame(10, $sequence->getInitialValue());
$foundSequence = $sequence;
return;
}
}
self::assertNotNull($foundSequence, "Sequence with name 'list_sequences_test_seq' was not found.");
self::assertSame(20, $foundSequence->getAllocationSize(), 'Allocation Size is expected to be 20.');
self::assertSame(10, $foundSequence->getInitialValue(), 'Initial Value is expected to be 10.');
self::fail('Sequence was not found.');
}
public function testListDatabases() : void
......
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