Code Duplication    Length = 9-9 lines in 2 locations

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' : ''),

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' : ''),