Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1681-1699 (lines=19) @@
1678
   *
1679
   * @return bool
1680
   */
1681
  public function matches(\Closure $closure)
1682
  {
1683
    if (count($this->array) === 0) {
1684
      return false;
1685
    }
1686
1687
    // init
1688
    $array = $this->array;
1689
1690
    foreach ($array as $key => $value) {
1691
      $value = $closure($value, $key);
1692
1693
      if ($value === false) {
1694
        return false;
1695
      }
1696
    }
1697
1698
    return true;
1699
  }
1700
1701
  /**
1702
   * Check if any item in the current array matches a truth test.
@@ 1708-1726 (lines=19) @@
1705
   *
1706
   * @return bool
1707
   */
1708
  public function matchesAny(\Closure $closure)
1709
  {
1710
    if (count($this->array) === 0) {
1711
      return false;
1712
    }
1713
1714
    // init
1715
    $array = $this->array;
1716
1717
    foreach ($array as $key => $value) {
1718
      $value = $closure($value, $key);
1719
1720
      if ($value === true) {
1721
        return true;
1722
      }
1723
    }
1724
1725
    return false;
1726
  }
1727
1728
  /**
1729
   * Get the max value from an array.