Total Complexity | 5 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class IdConsumer extends GenericConsumer |
||
16 | { |
||
17 | /** |
||
18 | * Overridden to return patterns matching the beginning part of an ID ('<' |
||
19 | * and '>' chars). |
||
20 | * |
||
21 | * @return string[] the patterns |
||
22 | */ |
||
23 | 29 | public function getTokenSeparators() |
|
24 | { |
||
25 | 29 | return [ '\s+', '<', '>' ]; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * Returns true for '>'. |
||
30 | */ |
||
31 | 29 | protected function isEndToken($token) |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * Returns true for '<'. |
||
38 | * |
||
39 | * @param string $token |
||
40 | * @return boolean false |
||
41 | */ |
||
42 | 26 | protected function isStartToken($token) |
|
45 | } |
||
46 | |||
47 | /** |
||
48 | * Returns null for whitespace, and LiteralPart for anything else. |
||
49 | * |
||
50 | * @param string $token the token |
||
51 | * @param bool $isLiteral set to true if the token represents a literal - |
||
52 | * e.g. an escaped token |
||
53 | * @return \ZBateson\MailMimeParser\Header\IHeaderPart|null the constructed |
||
54 | * header part or null if the token should be ignored |
||
55 | */ |
||
56 | 29 | protected function getPartForToken($token, $isLiteral) |
|
64 |