Code Duplication    Length = 14-14 lines in 2 locations

src/voku/db/DB.php 1 location

@@ 1122-1135 (lines=14) @@
1119
            $db = self::getInstance();
1120
        }
1121
1122
        if ($useCache) {
1123
            $cache = new Cache(null, null, false, $useCache);
1124
            $cacheKey = 'sql-' . \md5($query);
1125
1126
            if (
1127
                $cache->getCacheIsReady()
1128
                &&
1129
                $cache->existsItem($cacheKey)
1130
            ) {
1131
                return $cache->getItem($cacheKey);
1132
            }
1133
        } else {
1134
            $cache = false;
1135
        }
1136
1137
        $result = $db->query($query);
1138

src/voku/db/Helper.php 1 location

@@ 230-243 (lines=14) @@
227
          ' . $whereSQL . '
228
        ';
229
230
        if ($useCache) {
231
            $cache = new Cache(null, null, false, $useCache);
232
            $cacheKey = 'sql-phonetic-search-' . \md5($query);
233
234
            if (
235
                $cache->getCacheIsReady()
236
                &&
237
                $cache->existsItem($cacheKey)
238
            ) {
239
                return $cache->getItem($cacheKey);
240
            }
241
        } else {
242
            $cache = false;
243
        }
244
245
        $result = $dbConnection->query($query);
246