Code Duplication    Length = 9-9 lines in 2 locations

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

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

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

@@ 1019-1027 (lines=9) @@
1016
     */
1017
    protected function getIndexSqlDefinition(Index $index, $tableName)
1018
    {
1019
        if (is_string($index->getName())) {
1020
            $indexName = $index->getName();
1021
        } else {
1022
            $columnNames = $index->getColumns();
1023
            if (is_string($columnNames)) {
1024
                $columnNames = [$columnNames];
1025
            }
1026
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1027
        }
1028
        $def = sprintf(
1029
            "CREATE %s INDEX %s ON %s (%s);",
1030
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),