Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

@@ 771-785 (lines=15) @@
768
    /**
769
     * @return string A string representation of all of the currently set refinements.
770
     */
771
    public function getRefinementString()
772
    {
773
        if (!empty($this->navigations)) {
774
            $builder = new StringBuilder();
775
            foreach ($this->navigations as $n) {
776
                foreach ($n->getRefinements() as $r) {
777
                    $builder->append(Symbol::TILDE)->append($n->getName())->append($r->toTildeString());
778
                }
779
            }
780
            if ($builder->length() > 0) {
781
                return $builder->__toString();
782
            }
783
        }
784
        return null;
785
    }
786
787
    /**
788
     * @return string A string representation of all of the currently set custom url parameters.
@@ 790-802 (lines=13) @@
787
    /**
788
     * @return string A string representation of all of the currently set custom url parameters.
789
     */
790
    public function getCustomUrlParamsString()
791
    {
792
        if (!empty($this->customUrlParams)) {
793
            $builder = new StringBuilder();
794
            foreach ($this->customUrlParams as $c) {
795
                $builder->append(Symbol::TILDE)->append($c->getKey())->append(Symbol::EQUAL)->append($c->getValue());
796
            }
797
            if ($builder->length() > 0) {
798
                return $builder->__toString();
799
            }
800
        }
801
        return null;
802
    }
803
804
    /**
805
     * @param MSort $sort