Processor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 7
c 1
b 0
f 0
dl 0
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 1
A __construct() 0 3 1
1
<?php
2
3
namespace gulch\Transliterato;
4
5
use gulch\Transliterato\Contract\SchemeInterface;
6
7
class Processor
8
{
9
    /**
10
     * @var SchemeInterface
11
     */
12
    private SchemeInterface $scheme;
13
14
    public function __construct(SchemeInterface $scheme)
15
    {
16
        $this->scheme = $scheme;
17
    }
18
19
    public function process(string $text): string
20
    {
21
        return \str_replace(
22
            $this->scheme->getSearchData(),
23
            $this->scheme->getReplaceData(),
24
            $text
25
        );
26
    }
27
}
28