Code Duplication    Length = 7-10 lines in 3 locations

lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php 1 location

@@ 337-346 (lines=10) @@
334
     */
335
    public function execute($params = null)
336
    {
337
        if ($params) {
338
            $hasZeroIndex = array_key_exists(0, $params);
339
            foreach ($params as $key => $val) {
340
                if ($hasZeroIndex && is_numeric($key)) {
341
                    $this->bindValue($key + 1, $val);
342
                } else {
343
                    $this->bindValue($key, $val);
344
                }
345
            }
346
        }
347
348
        $ret = @oci_execute($this->_sth, $this->_conn->getExecuteMode());
349
        if ( ! $ret) {

lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php 1 location

@@ 172-180 (lines=9) @@
169
     */
170
    public function execute($params = null)
171
    {
172
        if (is_array($params)) {
173
            $hasZeroIndex = array_key_exists(0, $params);
174
175
            foreach ($params as $key => $val) {
176
                $key = ($hasZeroIndex && is_numeric($key)) ? $key + 1 : $key;
177
178
                $this->bindValue($key, $val);
179
            }
180
        }
181
182
        if ( ! sasql_stmt_execute($this->stmt)) {
183
            throw SQLAnywhereException::fromSQLAnywhereError($this->conn, $this->stmt);

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php 1 location

@@ 224-230 (lines=7) @@
221
     */
222
    public function execute($params = null)
223
    {
224
        if ($params) {
225
            $hasZeroIndex = array_key_exists(0, $params);
226
            foreach ($params as $key => $val) {
227
                $key = ($hasZeroIndex && is_numeric($key)) ? $key + 1 : $key;
228
                $this->bindValue($key, $val);
229
            }
230
        }
231
232
        if ( ! $this->stmt) {
233
            $this->stmt = $this->prepare();