Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

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