Code Duplication    Length = 15-15 lines in 2 locations

src/voku/db/DB.php 1 location

@@ 873-887 (lines=15) @@
870
    $cacheKey = null;
871
    $db = self::getInstance();
872
873
    if ($useCache === true) {
874
      $cache = new Cache(null, null, false, $useCache);
875
      $cacheKey = 'sql-' . md5($query);
876
877
      if (
878
          $cache->getCacheIsReady() === true
879
          &&
880
          $cache->existsItem($cacheKey)
881
      ) {
882
        return $cache->getItem($cacheKey);
883
      }
884
885
    } else {
886
      $cache = false;
887
    }
888
889
    $result = $db->query($query);
890

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