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

@@ 832-846 (lines=15) @@
829
    $cacheKey = null;
830
    $db = self::getInstance();
831
832
    if ($useCache === true) {
833
      $cache = new Cache(null, null, false, $useCache);
834
      $cacheKey = 'sql-' . md5($query);
835
836
      if (
837
          $cache->getCacheIsReady() === true
838
          &&
839
          $cache->existsItem($cacheKey)
840
      ) {
841
        return $cache->getItem($cacheKey);
842
      }
843
844
    } else {
845
      $cache = false;
846
    }
847
848
    $result = $db->query($query);
849