Code Duplication    Length = 14-14 lines in 2 locations

src/Arrayy.php 2 locations

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