Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 112-116 (lines=5) @@
109
110
            // support arbitrary \PDO::MYSQL_ATTR_* driver options and pass them to PDO
111
            // http://php.net/manual/en/ref.pdo-mysql.php#pdo-mysql.constants
112
            foreach ($options as $key => $option) {
113
                if (strpos($key, 'mysql_attr_') === 0) {
114
                    $driverOptions[constant('\PDO::' . strtoupper($key))] = $option;
115
                }
116
            }
117
118
            try {
119
                $db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions);

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

@@ 84-88 (lines=5) @@
81
82
            // support arbitrary \PDO::SQLSRV_ATTR_* driver options and pass them to PDO
83
            // http://php.net/manual/en/ref.pdo-sqlsrv.php#pdo-sqlsrv.constants
84
            foreach ($options as $key => $option) {
85
                if (strpos($key, 'sqlsrv_attr_') === 0) {
86
                    $driverOptions[constant('\PDO::' . strtoupper($key))] = $option;
87
                }
88
            }
89
90
            try {
91
                $db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions);