Passed
Branch php8-testing (0e47ea)
by Zaahid
03:09
created

IdConsumer::getTokenSeparators()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 * This file is part of the ZBateson\MailMimeParser project.
4
 *
5
 * @license http://opensource.org/licenses/bsd-license.php BSD
6
 */
7
namespace ZBateson\MailMimeParser\Header\Consumer;
8
9
/**
10
 * Parses a single ID from an ID header.  Begins consuming on a '<' char, and
11
 * ends on a '>' char.
12
 *
13
 * @author Zaahid Bateson
14
 */
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 13
    public function getTokenSeparators()
24
    {
25 13
        return ['\s+', '<', '>'];
26
    }
27
    
28
    /**
29
     * Returns true for '>'.
30
     */
31 13
    protected function isEndToken($token)
32
    {
33 13
        return ($token === '>');
34
    }
35
    
36
    /**
37
     * Returns true for '<'.
38
     * 
39
     * @param string $token
40
     * @return boolean false
41
     */
42 10
    protected function isStartToken($token)
43
    {
44 10
        return ($token === '<');
45
    }
46
}
47