Code Duplication    Length = 9-9 lines in 2 locations

src/Import.php 1 location

@@ 210-218 (lines=9) @@
207
    private function buildRequestRate($array)
208
    {
209
        $result = [];
210
        foreach ($array as $pair) {
211
            $string = self::DIRECTIVE_REQUEST_RATE . ':1/' . $pair['rate'] . 's';
212
            if (isset($pair['from']) &&
213
                isset($pair['to'])
214
            ) {
215
                $string .= ' ' . $pair['from'] . '-' . $pair['to'];
216
            }
217
            $result[] = $string;
218
        }
219
        return $result;
220
    }
221

src/Parser/Directives/RequestRateParser.php 1 location

@@ 136-144 (lines=9) @@
133
    public function render(RenderHandler $handler)
134
    {
135
        $this->sort();
136
        foreach ($this->requestRates as $array) {
137
            $suffix = 's';
138
            if (isset($array['from']) &&
139
                isset($array['to'])
140
            ) {
141
                $suffix .= ' ' . $array['from'] . '-' . $array['to'];
142
            }
143
            $handler->add(self::DIRECTIVE_REQUEST_RATE, '1/' . $array['rate'] . $suffix);
144
        }
145
        return true;
146
    }
147
}