Code Duplication    Length = 14-14 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1417-1430 (lines=14) @@
1414
   *
1415
   * @return bool
1416
   */
1417
  public function matches(\Closure $closure)
1418
  {
1419
    // Reduce the array to only booleans
1420
    $array = $this->each($closure);
1421
1422
    // Check the results
1423
    if (count($array) === 0) {
1424
      return true;
1425
    }
1426
1427
    $array = array_search(false, $array->toArray(), false);
1428
1429
    return is_bool($array);
1430
  }
1431
1432
  /**
1433
   * Check if any item in the current array matches a truth test.
@@ 1439-1452 (lines=14) @@
1436
   *
1437
   * @return bool
1438
   */
1439
  public function matchesAny(\Closure $closure)
1440
  {
1441
    // Reduce the array to only booleans
1442
    $array = $this->each($closure);
1443
1444
    // Check the results
1445
    if (count($array) === 0) {
1446
      return true;
1447
    }
1448
1449
    $array = array_search(true, $array->toArray(), false);
1450
1451
    return is_int($array);
1452
  }
1453
1454
  /**
1455
   * Get the max value from an array.