Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

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