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