Code Duplication    Length = 8-8 lines in 3 locations

src/RunOpenCode/ExchangeRate/Repository/FileRepository.php 1 location

@@ 237-244 (lines=8) @@
234
     * @param string $sourceName
235
     * @return string
236
     */
237
    protected function getRateKey($currencyCode, $date, $rateType, $sourceName)
238
    {
239
        return str_replace(
240
            array('%currency_code%', '%date%', '%rate_type%', '%source_name%'),
241
            array($currencyCode, $date->format('Y-m-d'), $rateType, $sourceName),
242
            '%currency_code%_%date%_%rate_type%_%source_name%'
243
        );
244
    }
245
246
    /**
247
     * Initializes file storage.

src/RunOpenCode/ExchangeRate/Repository/MemoryRepository.php 1 location

@@ 160-167 (lines=8) @@
157
     * @param string $sourceName
158
     * @return string
159
     */
160
    protected function getRateKey($currencyCode, $date, $rateType, $sourceName)
161
    {
162
        return str_replace(
163
            array('%currency_code%', '%date%', '%rate_type%', '%source_name%'),
164
            array($currencyCode, $date->format('Y-m-d'), $rateType, $sourceName),
165
            '%currency_code%_%date%_%rate_type%_%source_name%'
166
        );
167
    }
168
169
    /**
170
     * Extract requested page from filter criteria.

src/RunOpenCode/ExchangeRate/Repository/DoctrineDbalRepository.php 1 location

@@ 325-332 (lines=8) @@
322
     * @param string $sourceName
323
     * @return string
324
     */
325
    protected function getRateKey($currencyCode, $date, $rateType, $sourceName)
326
    {
327
        return str_replace(
328
            array('%currency_code%', '%date%', '%rate_type%', '%source_name%'),
329
            array($currencyCode, $date->format('Y-m-d'), $rateType, $sourceName),
330
            '%currency_code%_%date%_%rate_type%_%source_name%'
331
        );
332
    }
333
334
    /**
335
     * Initialize table schema where rates would be stored.