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/DoctrineDbalRepository.php 1 location

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

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.