| Total Complexity | 6 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class Coder implements Formatter |
||
| 12 | { |
||
| 13 | use Chaining; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var CodeMap Code map for coding character trees. |
||
| 17 | */ |
||
| 18 | private $codeMap; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param CodeMap $codeMap Code map for coding character trees. |
||
| 22 | */ |
||
| 23 | 5 | public function __construct(CodeMap $codeMap) |
|
| 26 | 5 | } |
|
| 27 | |||
| 28 | /** |
||
| 29 | * @param CharTree $charTree Character tree to format. |
||
| 30 | * @return CharTree Coded variant of the character tree. |
||
| 31 | */ |
||
| 32 | 5 | protected function applyCurrent(CharTree $charTree): CharTree |
|
| 33 | { |
||
| 34 | 5 | return $this->format($charTree); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param CharTree $charTree Character tree to format. |
||
| 39 | * @return CharTree Coded variant of the character tree. Memoization is not used. |
||
| 40 | */ |
||
| 41 | 5 | private function format(CharTree $charTree): CharTree |
|
| 58 | } |
||
| 59 | } |
||
| 60 |