Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

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