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

ReceivedDateConsumer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isStartToken() 0 3 1
A getTokenSeparators() 0 3 1
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