Passed
Push — master ( 46ed75...ca2387 )
by Zaahid
03:33
created

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