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

IdHeader::getId()   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
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
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;
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