Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2092-2110 (lines=19) @@
2089
   *
2090
   * @return bool
2091
   */
2092
  public function matches(\Closure $closure)
2093
  {
2094
    if (count($this->array) === 0) {
2095
      return false;
2096
    }
2097
2098
    // init
2099
    $array = $this->array;
2100
2101
    foreach ($array as $key => $value) {
2102
      $value = $closure($value, $key);
2103
2104
      if ($value === false) {
2105
        return false;
2106
      }
2107
    }
2108
2109
    return true;
2110
  }
2111
2112
  /**
2113
   * Check if any item in the current array matches a truth test.
@@ 2119-2137 (lines=19) @@
2116
   *
2117
   * @return bool
2118
   */
2119
  public function matchesAny(\Closure $closure)
2120
  {
2121
    if (count($this->array) === 0) {
2122
      return false;
2123
    }
2124
2125
    // init
2126
    $array = $this->array;
2127
2128
    foreach ($array as $key => $value) {
2129
      $value = $closure($value, $key);
2130
2131
      if ($value === true) {
2132
        return true;
2133
      }
2134
    }
2135
2136
    return false;
2137
  }
2138
2139
  /**
2140
   * Get the max value from an array.