Completed
Push — master ( 891643...c9f30c )
by Asmir
14:46 queued 12:49
created

ContentDecoder::decode()   A

Complexity

Conditions 4
Paths 4

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4.25

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 6
cts 8
cp 0.75
rs 9.2
c 0
b 0
f 0
cc 4
eloc 8
nc 4
nop 2
crap 4.25
1
<?php
2
3
namespace Goetas\Mail\ToSwiftMailParser\Mime;
4
5
class ContentDecoder
6
{
7 5
    public function decode($string, $from)
8
    {
9 5
        if ($from == "base64") {
10 1
            return base64_decode($string);
11 4
        } elseif ($from == "7bit") {
12
            return quoted_printable_decode($string);
13 4
        } elseif ($from == "quoted-printable") {
14
            return quoted_printable_decode($string);
15
        }
16 4
        return $string;
17
    }
18
}
19