Code Duplication    Length = 14-14 lines in 2 locations

src/voku/db/DB.php 1 location

@@ 1146-1159 (lines=14) @@
1143
            $db = self::getInstance();
1144
        }
1145
1146
        if ($useCache) {
1147
            $cache = new \voku\cache\Cache(null, null, false, $useCache);
1148
            $cacheKey = 'sql-' . \md5($query);
1149
1150
            if (
1151
                $cache->getCacheIsReady()
1152
                &&
1153
                $cache->existsItem($cacheKey)
1154
            ) {
1155
                return $cache->getItem($cacheKey);
1156
            }
1157
        } else {
1158
            $cache = false;
1159
        }
1160
1161
        $result = $db->query($query);
1162

src/voku/db/Helper.php 1 location

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