Total Complexity | 8 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | abstract class PartParser |
||
13 | { |
||
14 | /** |
||
15 | * @var Warning[] |
||
16 | */ |
||
17 | protected $warnings = []; |
||
18 | |||
19 | /** |
||
20 | * @var EmailLexer |
||
21 | */ |
||
22 | protected $lexer; |
||
23 | 186 | ||
24 | public function __construct(EmailLexer $lexer) |
||
25 | 186 | { |
|
26 | $this->lexer = $lexer; |
||
27 | } |
||
28 | |||
29 | abstract public function parse(): Result; |
||
30 | |||
31 | /** |
||
32 | * @return Warning[] |
||
33 | 186 | */ |
|
34 | public function getWarnings() |
||
37 | } |
||
38 | 114 | ||
39 | protected function parseFWS(): Result |
||
40 | 114 | { |
|
41 | 114 | $foldingWS = new FoldingWhiteSpace($this->lexer); |
|
42 | 114 | $resultFWS = $foldingWS->parse(); |
|
43 | 114 | $this->warnings = array_merge($this->warnings, $foldingWS->getWarnings()); |
|
44 | return $resultFWS; |
||
45 | } |
||
46 | 132 | ||
47 | protected function checkConsecutiveDots(): Result |
||
54 | } |
||
55 | 174 | ||
56 | protected function escaped(): bool |
||
64 |