Completed
Push — master ( 7a0fb6...891643 )
by Asmir
24:50 queued 22:48
created

ContentDecoder   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 14
c 0
b 0
f 0
ccs 5
cts 8
cp 0.625
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A decode() 0 11 4
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
            return base64_decode($string);
11 5
        } elseif ($from == "7bit") {
12
            return quoted_printable_decode($string);
13 5
        } elseif ($from == "quoted-printable") {
14
            return quoted_printable_decode($string);
15
        }
16 5
        return $string;
17
    }
18
}
19