1 | <?php |
||
21 | class AddressBaseConsumer extends AbstractConsumer |
||
22 | { |
||
23 | /** |
||
24 | * Returns \ZBateson\MailMimeParser\Header\Consumer\AddressConsumer as a |
||
25 | * sub-consumer. |
||
26 | * |
||
27 | * @return AbstractConsumer[] the sub-consumers |
||
28 | */ |
||
29 | 3 | protected function getSubConsumers() |
|
35 | |||
36 | /** |
||
37 | * Returns an empty array. |
||
38 | * |
||
39 | * @return string[] an array of regex pattern matchers |
||
40 | */ |
||
41 | 3 | protected function getTokenSeparators() |
|
45 | |||
46 | /** |
||
47 | * Disables advancing for start tokens. |
||
48 | * |
||
49 | * The start token for AddressBaseConsumer is part of an AddressPart (or a |
||
50 | * sub-consumer) and so must be passed on. |
||
51 | * |
||
52 | * @param Iterator $tokens |
||
53 | * @param bool $isStartToken |
||
54 | */ |
||
55 | 3 | protected function advanceToNextToken(Iterator $tokens, $isStartToken) |
|
56 | { |
||
57 | 3 | if ($isStartToken) { |
|
58 | 3 | return; |
|
59 | } |
||
60 | 3 | parent::advanceToNextToken($tokens, $isStartToken); |
|
61 | 3 | } |
|
62 | |||
63 | /** |
||
64 | * AddressBaseConsumer doesn't have start/end tokens, and so always returns |
||
65 | * false. |
||
66 | * |
||
67 | * @param string $token |
||
68 | * @return boolean false |
||
69 | */ |
||
70 | 3 | protected function isEndToken($token) |
|
74 | |||
75 | /** |
||
76 | * AddressBaseConsumer doesn't have start/end tokens, and so always returns |
||
77 | * false. |
||
78 | * |
||
79 | * @codeCoverageIgnore |
||
80 | * @param string $token |
||
81 | * @return boolean false |
||
82 | */ |
||
83 | protected function isStartToken($token) |
||
87 | |||
88 | /** |
||
89 | * Never reached by AddressBaseConsumer. Overridden to satisfy |
||
90 | * AbstractConsumer. |
||
91 | * |
||
92 | * @codeCoverageIgnore |
||
93 | * @param string $token the token |
||
94 | * @param bool $isLiteral set to true if the token represents a literal - |
||
95 | * e.g. an escaped token |
||
96 | * @return \ZBateson\MailMimeParser\Header\Part\HeaderPart the constructed header |
||
97 | * part or null if the token should be ignored |
||
98 | */ |
||
99 | protected function getPartForToken($token, $isLiteral) |
||
103 | } |
||
104 |