Code Duplication    Length = 19-19 lines in 2 locations

src/Arrayy.php 2 locations

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