Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

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