Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 971-979 (lines=9) @@
968
     */
969
    protected function getIndexSqlDefinition(Index $index, $tableName)
970
    {
971
        if (is_string($index->getName())) {
972
            $indexName = $index->getName();
973
        } else {
974
            $columnNames = $index->getColumns();
975
            if (is_string($columnNames)) {
976
                $columnNames = [$columnNames];
977
            }
978
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
979
        }
980
        $def = sprintf(
981
            "CREATE %s INDEX %s ON %s (%s);",
982
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1062-1070 (lines=9) @@
1059
     */
1060
    protected function getIndexSqlDefinition(Index $index, $tableName)
1061
    {
1062
        if (is_string($index->getName())) {
1063
            $indexName = $index->getName();
1064
        } else {
1065
            $columnNames = $index->getColumns();
1066
            if (is_string($columnNames)) {
1067
                $columnNames = [$columnNames];
1068
            }
1069
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1070
        }
1071
        $def = sprintf(
1072
            "CREATE %s INDEX %s ON %s (%s);",
1073
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),