Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

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