Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1700-1718 (lines=19) @@
1697
   *
1698
   * @return bool
1699
   */
1700
  public function matches(\Closure $closure)
1701
  {
1702
    if (count($this->array) === 0) {
1703
      return false;
1704
    }
1705
1706
    // init
1707
    $array = $this->array;
1708
1709
    foreach ($array as $key => $value) {
1710
      $value = $closure($value, $key);
1711
1712
      if ($value === false) {
1713
        return false;
1714
      }
1715
    }
1716
1717
    return true;
1718
  }
1719
1720
  /**
1721
   * Check if any item in the current array matches a truth test.
@@ 1727-1745 (lines=19) @@
1724
   *
1725
   * @return bool
1726
   */
1727
  public function matchesAny(\Closure $closure)
1728
  {
1729
    if (count($this->array) === 0) {
1730
      return false;
1731
    }
1732
1733
    // init
1734
    $array = $this->array;
1735
1736
    foreach ($array as $key => $value) {
1737
      $value = $closure($value, $key);
1738
1739
      if ($value === true) {
1740
        return true;
1741
      }
1742
    }
1743
1744
    return false;
1745
  }
1746
1747
  /**
1748
   * Get the max value from an array.