Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1928-1946 (lines=19) @@
1925
   *
1926
   * @return bool
1927
   */
1928
  public function matches(\Closure $closure)
1929
  {
1930
    if (count($this->array) === 0) {
1931
      return false;
1932
    }
1933
1934
    // init
1935
    $array = $this->array;
1936
1937
    foreach ($array as $key => $value) {
1938
      $value = $closure($value, $key);
1939
1940
      if ($value === false) {
1941
        return false;
1942
      }
1943
    }
1944
1945
    return true;
1946
  }
1947
1948
  /**
1949
   * Check if any item in the current array matches a truth test.
@@ 1955-1973 (lines=19) @@
1952
   *
1953
   * @return bool
1954
   */
1955
  public function matchesAny(\Closure $closure)
1956
  {
1957
    if (count($this->array) === 0) {
1958
      return false;
1959
    }
1960
1961
    // init
1962
    $array = $this->array;
1963
1964
    foreach ($array as $key => $value) {
1965
      $value = $closure($value, $key);
1966
1967
      if ($value === true) {
1968
        return true;
1969
      }
1970
    }
1971
1972
    return false;
1973
  }
1974
1975
  /**
1976
   * Get the max value from an array.