Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1856-1874 (lines=19) @@
1853
   *
1854
   * @return bool
1855
   */
1856
  public function matches(\Closure $closure)
1857
  {
1858
    if (count($this->array) === 0) {
1859
      return false;
1860
    }
1861
1862
    // init
1863
    $array = $this->array;
1864
1865
    foreach ($array as $key => $value) {
1866
      $value = $closure($value, $key);
1867
1868
      if ($value === false) {
1869
        return false;
1870
      }
1871
    }
1872
1873
    return true;
1874
  }
1875
1876
  /**
1877
   * Check if any item in the current array matches a truth test.
@@ 1883-1901 (lines=19) @@
1880
   *
1881
   * @return bool
1882
   */
1883
  public function matchesAny(\Closure $closure)
1884
  {
1885
    if (count($this->array) === 0) {
1886
      return false;
1887
    }
1888
1889
    // init
1890
    $array = $this->array;
1891
1892
    foreach ($array as $key => $value) {
1893
      $value = $closure($value, $key);
1894
1895
      if ($value === true) {
1896
        return true;
1897
      }
1898
    }
1899
1900
    return false;
1901
  }
1902
1903
  /**
1904
   * Get the max value from an array.