Completed
Push — feature-20rc1 ( 008ae2 )
by Rob
16:55
created

PsrFormat   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A interpolate() 0 8 2
1
<?php
2
3
/*
4
 * This file is part of the `liip/LiipImagineBundle` project.
5
 *
6
 * (c) https://github.com/liip/LiipImagineBundle/graphs/contributors
7
 *
8
 * For the full copyright and license information, please view the LICENSE.md
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Liip\ImagineBundle\Log\Formatter;
13
14
/**
15
 * @author Rob Frawley 2nd <[email protected]>
16
 */
17
final class PsrFormat extends AbstractFormat
18
{
19
    /**
20
     * @param string $message
21
     * @param array  $replacements
22
     *
23
     * @return string
24
     */
25
    protected function interpolate(string $message, array $replacements): string
26
    {
27
        foreach ($this->normalizeReplacements($replacements) as $search => $replace) {
28
            $message = str_replace(sprintf('{%s}', $search), $replace, $message);
29
        }
30
31
        return $message;
32
    }
33
}
34