Code Duplication    Length = 15-15 lines in 2 locations

src/voku/db/Helper.php 1 location

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

src/voku/db/DB.php 1 location

@@ 990-1004 (lines=15) @@
987
      $db = self::getInstance();
988
    }
989
990
    if ($useCache === true) {
991
      $cache = new Cache(null, null, false, $useCache);
992
      $cacheKey = 'sql-' . md5($query);
993
994
      if (
995
          $cache->getCacheIsReady() === true
996
          &&
997
          $cache->existsItem($cacheKey)
998
      ) {
999
        return $cache->getItem($cacheKey);
1000
      }
1001
1002
    } else {
1003
      $cache = false;
1004
    }
1005
1006
    $result = $db->query($query);
1007