Test Failed
Push — master ( 66d82e...4ebaf8 )
by Zaahid
03:17
created

ReceivedDateConsumer::getTokenSeparators()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\Received;
8
9
use ZBateson\MailMimeParser\Header\Consumer\DateConsumer;
10
11
/**
12
 * Parses the date portion of a Received header into a DatePart.
13
 *
14
 * The only difference between DateConsumer and ReceivedDateConsumer is the
15
 * addition of a start token, ';', and a token separator (also ';').
16
 *
17
 * @author Zaahid Bateson
18
 */
19
class ReceivedDateConsumer extends DateConsumer
20
{
21
    /**
22
     * Returns true if the token is a ';'
23
     * 
24
     * @param string $token
25
     * @return boolean
26
     */
27
    protected function isStartToken($token)
28
    {
29
        return ($token === ';');
30
    }
31
32
    /**
33
     * Returns an array containing ';'.
34
     *
35
     * @return string[] an array of regex pattern matchers
36
     */
37
    protected function getTokenSeparators()
38
    {
39
        return [';'];
40
    }
41
}
42