Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

@@ 745-759 (lines=15) @@
742
    /**
743
     * @return string A string representation of all of the currently set refinements.
744
     */
745
    public function getRefinementString()
746
    {
747
        if (!empty($this->navigations)) {
748
            $builder = new StringBuilder();
749
            foreach ($this->navigations as $n) {
750
                foreach ($n->getRefinements() as $r) {
751
                    $builder->append(Symbol::TILDE)->append($n->getName())->append($r->toTildeString());
752
                }
753
            }
754
            if ($builder->length() > 0) {
755
                return $builder->__toString();
756
            }
757
        }
758
        return null;
759
    }
760
761
    /**
762
     * @return string A string representation of all of the currently set custom url parameters.
@@ 764-776 (lines=13) @@
761
    /**
762
     * @return string A string representation of all of the currently set custom url parameters.
763
     */
764
    public function getCustomUrlParamsString()
765
    {
766
        if (!empty($this->customUrlParams)) {
767
            $builder = new StringBuilder();
768
            foreach ($this->customUrlParams as $c) {
769
                $builder->append(Symbol::TILDE)->append($c->getKey())->append(Symbol::EQUAL)->append($c->getValue());
770
            }
771
            if ($builder->length() > 0) {
772
                return $builder->__toString();
773
            }
774
        }
775
        return null;
776
    }
777
778
    /**
779
     * @param MSort $sort