Code Duplication    Length = 9-9 lines in 2 locations

src/Import.php 1 location

@@ 198-206 (lines=9) @@
195
    private function buildRequestRate($array)
196
    {
197
        $result = [];
198
        foreach ($array as $pair) {
199
            $string = self::DIRECTIVE_REQUEST_RATE . ':' . $pair['ratio'];
200
            if (isset($pair['from']) &&
201
                isset($pair['to'])
202
            ) {
203
                $string .= ' ' . $pair['from'] . '-' . $pair['to'];
204
            }
205
            $result[] = $string;
206
        }
207
        return $result;
208
    }
209

src/Parser/Directives/RequestRateParser.php 1 location

@@ 177-185 (lines=9) @@
174
    public function render(RenderHandler $handler)
175
    {
176
        $this->sort();
177
        foreach ($this->requestRates as $array) {
178
            $time = '';
179
            if (isset($array['from']) &&
180
                isset($array['to'])
181
            ) {
182
                $time .= ' ' . $array['from'] . '-' . $array['to'];
183
            }
184
            $handler->add(self::DIRECTIVE_REQUEST_RATE, $array['ratio'] . $time);
185
        }
186
        return true;
187
    }
188
}