Code Duplication    Length = 15-15 lines in 2 locations

src/voku/db/Helper.php 1 location

@@ 197-211 (lines=15) @@
194
      ' . $whereSQL . '
195
    ';
196
197
    if ($useCache === true) {
198
      $cache = new Cache(null, null, false, $useCache);
199
      $cacheKey = 'sql-phonetic-search-' . \md5($query);
200
201
      if (
202
          $cache->getCacheIsReady() === true
203
          &&
204
          $cache->existsItem($cacheKey)
205
      ) {
206
        return $cache->getItem($cacheKey);
207
      }
208
209
    } else {
210
      $cache = false;
211
    }
212
213
    $result = $dbConnection->query($query);
214

src/voku/db/DB.php 1 location

@@ 1088-1102 (lines=15) @@
1085
      $db = self::getInstance();
1086
    }
1087
1088
    if ($useCache === true) {
1089
      $cache = new Cache(null, null, false, $useCache);
1090
      $cacheKey = 'sql-' . \md5($query);
1091
1092
      if (
1093
          $cache->getCacheIsReady() === true
1094
          &&
1095
          $cache->existsItem($cacheKey)
1096
      ) {
1097
        return $cache->getItem($cacheKey);
1098
      }
1099
1100
    } else {
1101
      $cache = false;
1102
    }
1103
1104
    $result = $db->query($query);
1105