Code Duplication    Length = 6-12 lines in 3 locations

typo3/sysext/core/Classes/Cache/Backend/Typo3DatabaseBackend.php 2 locations

@@ 421-427 (lines=7) @@
418
            while ($row = $result->fetch()) {
419
                $cacheEntryIdentifiers[] = $row['identifier'];
420
            }
421
            if (!empty($cacheEntryIdentifiers)) {
422
                // Delete tag rows connected to expired cache entries
423
                $quotedIdentifiers = $queryBuilder->createNamedParameter($cacheEntryIdentifiers, Connection::PARAM_STR_ARRAY);
424
                $queryBuilder->delete($this->tagsTable)
425
                    ->where($queryBuilder->expr()->in('identifier', $quotedIdentifiers))
426
                    ->execute();
427
            }
428
            $queryBuilder->delete($this->cacheTable)
429
                ->where($queryBuilder->expr()->lt(
430
                    'expires',
@@ 452-457 (lines=6) @@
449
            while ($row = $result->fetch()) {
450
                $tagsEntryIdentifiers[] = $row['identifier'];
451
            }
452
            if (!empty($tagsEntryIdentifiers)) {
453
                $quotedIdentifiers = $queryBuilder->createNamedParameter($tagsEntryIdentifiers, Connection::PARAM_STR_ARRAY);
454
                $queryBuilder->delete($this->tagsTable)
455
                    ->where($queryBuilder->expr()->in('identifier', $quotedIdentifiers))
456
                    ->execute();
457
            }
458
        }
459
    }
460

typo3/sysext/core/Classes/Database/ReferenceIndex.php 1 location

@@ 292-303 (lines=12) @@
289
            if (!empty($hashList)) {
290
                $result['deletedNodes'] = count($hashList);
291
                $result['deletedNodes_hashList'] = implode(',', $hashList);
292
                if (!$testOnly) {
293
                    $queryBuilder = $connection->createQueryBuilder();
294
                    $queryBuilder
295
                        ->delete('sys_refindex')
296
                        ->where(
297
                            $queryBuilder->expr()->in(
298
                                'hash',
299
                                $queryBuilder->createNamedParameter($hashList, Connection::PARAM_STR_ARRAY)
300
                            )
301
                        )
302
                        ->execute();
303
                }
304
            }
305
        }
306