Code Duplication    Length = 15-15 lines in 2 locations

src/voku/db/Helper.php 1 location

@@ 137-151 (lines=15) @@
134
      ' . $whereSQL . '
135
    ';
136
137
    if ($useCache === true) {
138
      $cache = new Cache(null, null, false, $useCache);
139
      $cacheKey = 'sql-phonetic-search-' . md5($query);
140
141
      if (
142
          $cache->getCacheIsReady() === true
143
          &&
144
          $cache->existsItem($cacheKey)
145
      ) {
146
        return $cache->getItem($cacheKey);
147
      }
148
149
    } else {
150
      $cache = false;
151
    }
152
153
    $result = $dbConnection->query($query);
154

src/voku/db/DB.php 1 location

@@ 979-993 (lines=15) @@
976
      $db = self::getInstance();
977
    }
978
979
    if ($useCache === true) {
980
      $cache = new Cache(null, null, false, $useCache);
981
      $cacheKey = 'sql-' . md5($query);
982
983
      if (
984
          $cache->getCacheIsReady() === true
985
          &&
986
          $cache->existsItem($cacheKey)
987
      ) {
988
        return $cache->getItem($cacheKey);
989
      }
990
991
    } else {
992
      $cache = false;
993
    }
994
995
    $result = $db->query($query);
996