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

@@ 1005-1019 (lines=15) @@
1002
      $db = self::getInstance();
1003
    }
1004
1005
    if ($useCache === true) {
1006
      $cache = new Cache(null, null, false, $useCache);
1007
      $cacheKey = 'sql-' . \md5($query);
1008
1009
      if (
1010
          $cache->getCacheIsReady() === true
1011
          &&
1012
          $cache->existsItem($cacheKey)
1013
      ) {
1014
        return $cache->getItem($cacheKey);
1015
      }
1016
1017
    } else {
1018
      $cache = false;
1019
    }
1020
1021
    $result = $db->query($query);
1022