Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit cf7579c

Browse files
author
Sergii Kovalenko
committed
MAGETWO-87190: Test coverage for critical logic
1 parent eddf58e commit cf7579c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

setup/src/Magento/Setup/Model/Declaration/Schema/Diff/SchemaDiff.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ public function __construct(
7070
*/
7171
private function createTableIndex(array $tableNames, array $generatedTableNames)
7272
{
73-
$tableNames = array_flip($tableNames);
7473
foreach ($generatedTableNames as $tableName) {
7574
//If table exists only in db
76-
if (!isset($tableNames[$tableName])) {
77-
array_push($tableNames, $tableName);
75+
if (!in_array($tableName, $tableNames)) {
76+
$tableNames[] = $tableName;
7877
}
7978
}
8079

81-
return $tableNames;
80+
return array_flip($tableNames);
8281
}
8382

8483
/**

0 commit comments

Comments
 (0)