Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | final class Coalesce implements Translator |
||
10 | { |
||
11 | /** |
||
12 | * @var (Translator|null)[] |
||
13 | */ |
||
14 | private $translators; |
||
15 | |||
16 | private function __construct(array $translators) |
||
17 | { |
||
18 | $this->translators = $translators; |
||
19 | } |
||
20 | |||
21 | public static function withTranslators(?Translator ...$translators): self |
||
22 | { |
||
23 | return new self($translators); |
||
24 | } |
||
25 | |||
26 | public function translate(string $string): string |
||
35 | } |
||
36 | } |
||
37 |