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

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