Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2317-2335 (lines=19) @@
2314
   *
2315
   * @return bool
2316
   */
2317
  public function matches(\Closure $closure)
2318
  {
2319
    if (\count($this->array) === 0) {
2320
      return false;
2321
    }
2322
2323
    // init
2324
    $array = $this->array;
2325
2326
    foreach ($array as $key => $value) {
2327
      $value = $closure($value, $key);
2328
2329
      if ($value === false) {
2330
        return false;
2331
      }
2332
    }
2333
2334
    return true;
2335
  }
2336
2337
  /**
2338
   * Check if any item in the current array matches a truth test.
@@ 2344-2362 (lines=19) @@
2341
   *
2342
   * @return bool
2343
   */
2344
  public function matchesAny(\Closure $closure)
2345
  {
2346
    if (\count($this->array) === 0) {
2347
      return false;
2348
    }
2349
2350
    // init
2351
    $array = $this->array;
2352
2353
    foreach ($array as $key => $value) {
2354
      $value = $closure($value, $key);
2355
2356
      if ($value === true) {
2357
        return true;
2358
      }
2359
    }
2360
2361
    return false;
2362
  }
2363
2364
  /**
2365
   * Get the max value from an array.