Passed
Push — master ( a0eabd...66d82e )
by Zaahid
03:20
created

IdHeader   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 15
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getId() 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;
8
9
/**
10
 * Represents a Content-ID or Message-ID header.
11
 * 
12
 * @author Zaahid Bateson
13
 */
14
class IdHeader extends GenericHeader
15
{
16
    /**
17
     * Strips out leading and trailing less than and greater than ('<', '>')
18
     * chars to return just the ID portion of the header.  If '<>' chars aren't
19
     * found, the value is returned as-is.
20
     *
21
     * For example, a header value of <[email protected]> would return the
22
     * string '[email protected]'.
23
     * 
24
     * @return string
25
     */
26 3
    public function getId()
27
    {
28 3
        return preg_replace('/^<|>$/', '', $this->getValue());
29
    }
30
}
31