Processor::process()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 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