BatchProcessor::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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 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