Code Duplication    Length = 12-12 lines in 3 locations

src/Arrayy.php 3 locations

@@ 437-448 (lines=12) @@
434
   *
435
   * @throws \InvalidArgumentException
436
   */
437
  public function uasort($function)
438
  {
439
    if (!is_callable($function)) {
440
      throw new \InvalidArgumentException(
441
          'Passed function must be callable'
442
      );
443
    }
444
445
    uasort($this->array, $function);
446
447
    return $this;
448
  }
449
450
  /**
451
   * Sort the entries by keys using a user-defined comparison function.
@@ 835-846 (lines=12) @@
832
   *
833
   * @throws \InvalidArgumentException
834
   */
835
  public function customSortKeys($function)
836
  {
837
    if (!is_callable($function)) {
838
      throw new \InvalidArgumentException(
839
          'Passed function must be callable'
840
      );
841
    }
842
843
    uksort($this->array, $function);
844
845
    return $this;
846
  }
847
848
  /**
849
   * Custom sort by value via "usort".
@@ 859-870 (lines=12) @@
856
   *
857
   * @throws \InvalidArgumentException
858
   */
859
  public function customSortValues($function)
860
  {
861
    if (!is_callable($function)) {
862
      throw new \InvalidArgumentException(
863
          'Passed function must be callable'
864
      );
865
    }
866
867
    usort($this->array, $function);
868
869
    return $this;
870
  }
871
872
  /**
873
   * Return values that are only in the current array.