Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | final class LeetspeakDecoder implements Formatter |
||
12 | { |
||
13 | use Chaining; |
||
14 | |||
15 | /** |
||
16 | * @var Coder Leetspeak coder. |
||
17 | */ |
||
18 | private $leetspeakCoder; |
||
19 | |||
20 | /** |
||
21 | * @var CharTree[] Memoization of formatted character trees. |
||
22 | */ |
||
23 | private static $memoization = []; |
||
24 | |||
25 | 6 | public function __construct() |
|
26 | { |
||
27 | 6 | $this->leetspeakCoder = new Coder(new LeetspeakMap()); |
|
28 | 6 | } |
|
29 | |||
30 | /** |
||
31 | * @param CharTree $charTree Character tree to format. |
||
32 | * @return CharTree Leetspeak decoded variant of the character tree. |
||
33 | */ |
||
34 | 6 | protected function applyCurrent(CharTree $charTree): CharTree |
|
44 | } |
||
45 | } |
||
46 |