Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

@@ 2131-2149 (lines=19) @@
2128
   *
2129
   * @return bool
2130
   */
2131
  public function matches(\Closure $closure)
2132
  {
2133
    if (count($this->array) === 0) {
2134
      return false;
2135
    }
2136
2137
    // init
2138
    $array = $this->array;
2139
2140
    foreach ($array as $key => $value) {
2141
      $value = $closure($value, $key);
2142
2143
      if ($value === false) {
2144
        return false;
2145
      }
2146
    }
2147
2148
    return true;
2149
  }
2150
2151
  /**
2152
   * Check if any item in the current array matches a truth test.
@@ 2158-2176 (lines=19) @@
2155
   *
2156
   * @return bool
2157
   */
2158
  public function matchesAny(\Closure $closure)
2159
  {
2160
    if (count($this->array) === 0) {
2161
      return false;
2162
    }
2163
2164
    // init
2165
    $array = $this->array;
2166
2167
    foreach ($array as $key => $value) {
2168
      $value = $closure($value, $key);
2169
2170
      if ($value === true) {
2171
        return true;
2172
      }
2173
    }
2174
2175
    return false;
2176
  }
2177
2178
  /**
2179
   * Get the max value from an array.