Code Duplication    Length = 14-14 lines in 2 locations

src/Arrayy.php 2 locations

@@ 814-827 (lines=14) @@
811
   *
812
   * @return bool
813
   */
814
  public function matches(\Closure $closure)
815
  {
816
    // Reduce the array to only booleans
817
    $array = $this->each($closure);
818
819
    // Check the results
820
    if (count($array) === 0) {
821
      return true;
822
    }
823
824
    $array = array_search(false, $array->toArray(), false);
825
826
    return is_bool($array);
827
  }
828
829
  /**
830
   * Iterate over the current array and modify the array's value.
@@ 862-875 (lines=14) @@
859
   *
860
   * @return bool
861
   */
862
  public function matchesAny(\Closure $closure)
863
  {
864
    // Reduce the array to only booleans
865
    $array = $this->each($closure);
866
867
    // Check the results
868
    if (count($array) === 0) {
869
      return true;
870
    }
871
872
    $array = array_search(true, $array->toArray(), false);
873
874
    return is_int($array);
875
  }
876
877
  /**
878
   * Check whether array is associative or not.