Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1713-1731 (lines=19) @@
1710
   *
1711
   * @return bool
1712
   */
1713
  public function matches(\Closure $closure)
1714
  {
1715
    if (count($this->array) === 0) {
1716
      return false;
1717
    }
1718
1719
    // init
1720
    $array = $this->array;
1721
1722
    foreach ($array as $key => $value) {
1723
      $value = $closure($value, $key);
1724
1725
      if ($value === false) {
1726
        return false;
1727
      }
1728
    }
1729
1730
    return true;
1731
  }
1732
1733
  /**
1734
   * Check if any item in the current array matches a truth test.
@@ 1740-1758 (lines=19) @@
1737
   *
1738
   * @return bool
1739
   */
1740
  public function matchesAny(\Closure $closure)
1741
  {
1742
    if (count($this->array) === 0) {
1743
      return false;
1744
    }
1745
1746
    // init
1747
    $array = $this->array;
1748
1749
    foreach ($array as $key => $value) {
1750
      $value = $closure($value, $key);
1751
1752
      if ($value === true) {
1753
        return true;
1754
      }
1755
    }
1756
1757
    return false;
1758
  }
1759
1760
  /**
1761
   * Get the max value from an array.