Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1965-1983 (lines=19) @@
1962
   *
1963
   * @return bool
1964
   */
1965
  public function matches(\Closure $closure)
1966
  {
1967
    if (count($this->array) === 0) {
1968
      return false;
1969
    }
1970
1971
    // init
1972
    $array = $this->array;
1973
1974
    foreach ($array as $key => $value) {
1975
      $value = $closure($value, $key);
1976
1977
      if ($value === false) {
1978
        return false;
1979
      }
1980
    }
1981
1982
    return true;
1983
  }
1984
1985
  /**
1986
   * Check if any item in the current array matches a truth test.
@@ 1992-2010 (lines=19) @@
1989
   *
1990
   * @return bool
1991
   */
1992
  public function matchesAny(\Closure $closure)
1993
  {
1994
    if (count($this->array) === 0) {
1995
      return false;
1996
    }
1997
1998
    // init
1999
    $array = $this->array;
2000
2001
    foreach ($array as $key => $value) {
2002
      $value = $closure($value, $key);
2003
2004
      if ($value === true) {
2005
        return true;
2006
      }
2007
    }
2008
2009
    return false;
2010
  }
2011
2012
  /**
2013
   * Get the max value from an array.