Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

@@ 1073-1081 (lines=9) @@
1070
     */
1071
    protected function getIndexSqlDefinition(Index $index, $tableName)
1072
    {
1073
        if (is_string($index->getName())) {
1074
            $indexName = $index->getName();
1075
        } else {
1076
            $columnNames = $index->getColumns();
1077
            if (is_string($columnNames)) {
1078
                $columnNames = [$columnNames];
1079
            }
1080
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1081
        }
1082
        $def = sprintf(
1083
            "CREATE %s INDEX %s ON %s (%s);",
1084
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),