Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public function replace( |
||
18 | string $inputText, |
||
19 | Vocabulary $vocabulary, |
||
20 | string $direction = self::DIRECTION_LTR |
||
21 | ): string { |
||
22 | $map = array_replace($vocabulary->getPhrases(), $vocabulary->getWords()); |
||
23 | |||
24 | list($patterns, $replacements) = $this->buildPatternsAndReplacementsFromMap($map, $direction); |
||
25 | |||
26 | return preg_replace($patterns, $replacements, $inputText); |
||
27 | } |
||
53 |