Code Duplication    Length = 9-9 lines in 2 locations

src/Phinx/Db/Adapter/PostgresAdapter.php 1 location

@@ 988-996 (lines=9) @@
985
     */
986
    protected function getIndexSqlDefinition(Index $index, $tableName)
987
    {
988
        if (is_string($index->getName())) {
989
            $indexName = $index->getName();
990
        } else {
991
            $columnNames = $index->getColumns();
992
            if (is_string($columnNames)) {
993
                $columnNames = [$columnNames];
994
            }
995
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
996
        }
997
        $def = sprintf(
998
            "CREATE %s INDEX %s ON %s (%s);",
999
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location

@@ 1048-1056 (lines=9) @@
1045
     */
1046
    protected function getIndexSqlDefinition(Index $index, $tableName)
1047
    {
1048
        if (is_string($index->getName())) {
1049
            $indexName = $index->getName();
1050
        } else {
1051
            $columnNames = $index->getColumns();
1052
            if (is_string($columnNames)) {
1053
                $columnNames = [$columnNames];
1054
            }
1055
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1056
        }
1057
        $def = sprintf(
1058
            "CREATE %s INDEX %s ON %s (%s);",
1059
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),