Total Complexity | 4 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | final class Capitalizer implements Formatter |
||
12 | { |
||
13 | use Chaining; |
||
14 | |||
15 | /** |
||
16 | * @var LowerCaseConverter Lower case converter. |
||
17 | */ |
||
18 | private $lowerCaseConverter; |
||
19 | |||
20 | /** |
||
21 | * @var Cutter Character tree cutter for extracting the first character. |
||
22 | */ |
||
23 | private $charExtractor; |
||
24 | |||
25 | 7 | public function __construct() |
|
26 | { |
||
27 | 7 | $this->lowerCaseConverter = new LowerCaseConverter(); |
|
28 | 7 | $this->charExtractor = new Cutter(); |
|
29 | 7 | } |
|
30 | |||
31 | /** |
||
32 | * @param CharTree $charTree Character tree to format. |
||
33 | * @return CharTree Capitalized variant of the character tree. |
||
34 | */ |
||
35 | 7 | protected function applyCurrent(CharTree $charTree): CharTree |
|
52 | } |
||
53 | } |
||
54 |