Code Duplication    Length = 14-14 lines in 2 locations

src/Arrayy.php 2 locations

@@ 1352-1365 (lines=14) @@
1349
   *
1350
   * @return bool
1351
   */
1352
  public function matches(\Closure $closure)
1353
  {
1354
    // Reduce the array to only booleans
1355
    $array = $this->each($closure);
1356
1357
    // Check the results
1358
    if (count($array) === 0) {
1359
      return true;
1360
    }
1361
1362
    $array = array_search(false, $array->toArray(), false);
1363
1364
    return is_bool($array);
1365
  }
1366
1367
  /**
1368
   * Check if any item in the current array matches a truth test.
@@ 1374-1387 (lines=14) @@
1371
   *
1372
   * @return bool
1373
   */
1374
  public function matchesAny(\Closure $closure)
1375
  {
1376
    // Reduce the array to only booleans
1377
    $array = $this->each($closure);
1378
1379
    // Check the results
1380
    if (count($array) === 0) {
1381
      return true;
1382
    }
1383
1384
    $array = array_search(true, $array->toArray(), false);
1385
1386
    return is_int($array);
1387
  }
1388
1389
  /**
1390
   * Get the max value from an array.