BatchProcessor::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
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 9
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
namespace gulch\Transliterato;
4
5
use gulch\Transliterato\Contract\SchemeInterface;
6
7
class BatchProcessor
8
{
9
10
    /**
11
     * @var SchemeInterface[]
12
     */
13
    private array $schemes;
14
15
    public function __construct(SchemeInterface ...$schemes)
16
    {
17
        $this->schemes = $schemes;
18
    }
19
20
    public function process(string $text): array
21
    {
22
        $result = [];
23
24
        foreach ($this->schemes as $scheme) {
25
            $result[] = (new Processor($scheme))->process($text);
26
        }
27
28
        return $result;
29
    }
30
}
31