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

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