Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

@@ 785-799 (lines=15) @@
782
  /**
783
   * @return string A string representation of all of the currently set refinements.
784
   */
785
  public function getRefinementString()
786
  {
787
    if (!empty($this->navigations)) {
788
      $builder = new StringBuilder();
789
      foreach ($this->navigations as $n) {
790
        foreach ($n->getRefinements() as $r) {
791
          $builder->append(Symbol::TILDE)->append($n->getName())->append($r->toTildeString());
792
        }
793
      }
794
      if ($builder->length() > 0) {
795
        return $builder->__toString();
796
      }
797
    }
798
    return null;
799
  }
800
801
  /**
802
   * @return string A string representation of all of the currently set custom url parameters.
@@ 804-816 (lines=13) @@
801
  /**
802
   * @return string A string representation of all of the currently set custom url parameters.
803
   */
804
  public function getCustomUrlParamsString()
805
  {
806
    if (!empty($this->customUrlParams)) {
807
      $builder = new StringBuilder();
808
      foreach ($this->customUrlParams as $c) {
809
        $builder->append(Symbol::TILDE)->append($c->getKey())->append(Symbol::EQUAL)->append($c->getValue());
810
      }
811
      if ($builder->length() > 0) {
812
        return $builder->__toString();
813
      }
814
    }
815
    return null;
816
  }
817
818
  /**
819
   * @return MMatchStrategy