Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2288-2306 (lines=19) @@
2285
   *
2286
   * @return bool
2287
   */
2288
  public function matches(\Closure $closure): bool
2289
  {
2290
    if (\count($this->array) === 0) {
2291
      return false;
2292
    }
2293
2294
    // init
2295
    $array = $this->array;
2296
2297
    foreach ($array as $key => $value) {
2298
      $value = $closure($value, $key);
2299
2300
      if ($value === false) {
2301
        return false;
2302
      }
2303
    }
2304
2305
    return true;
2306
  }
2307
2308
  /**
2309
   * Check if any item in the current array matches a truth test.
@@ 2315-2333 (lines=19) @@
2312
   *
2313
   * @return bool
2314
   */
2315
  public function matchesAny(\Closure $closure): bool
2316
  {
2317
    if (\count($this->array) === 0) {
2318
      return false;
2319
    }
2320
2321
    // init
2322
    $array = $this->array;
2323
2324
    foreach ($array as $key => $value) {
2325
      $value = $closure($value, $key);
2326
2327
      if ($value === true) {
2328
        return true;
2329
      }
2330
    }
2331
2332
    return false;
2333
  }
2334
2335
  /**
2336
   * Get the max value from an array.