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

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