Code Duplication    Length = 13-15 lines in 2 locations

src/API/Query.php 2 locations

@@ 706-720 (lines=15) @@
703
    /**
704
     * @return string A string representation of all of the currently set refinements.
705
     */
706
    public function getRefinementString()
707
    {
708
        if (!empty($this->navigations)) {
709
            $builder = new StringBuilder();
710
            foreach ($this->navigations as $n) {
711
                foreach ($n->getRefinements() as $r) {
712
                    $builder->append(Symbol::TILDE)->append($n->getName())->append($r->toTildeString());
713
                }
714
            }
715
            if ($builder->length() > 0) {
716
                return $builder->__toString();
717
            }
718
        }
719
        return null;
720
    }
721
722
    /**
723
     * @return string A string representation of all of the currently set custom url parameters.
@@ 725-737 (lines=13) @@
722
    /**
723
     * @return string A string representation of all of the currently set custom url parameters.
724
     */
725
    public function getCustomUrlParamsString()
726
    {
727
        if (!empty($this->customUrlParams)) {
728
            $builder = new StringBuilder();
729
            foreach ($this->customUrlParams as $c) {
730
                $builder->append(Symbol::TILDE)->append($c->getKey())->append(Symbol::EQUAL)->append($c->getValue());
731
            }
732
            if ($builder->length() > 0) {
733
                return $builder->__toString();
734
            }
735
        }
736
        return null;
737
    }
738
739
    /**
740
     * @param MSort $sort