BatchProcessor   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A process() 0 9 2
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