ContentDecoder   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 19
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A decode() 0 16 4
1
<?php
2
3
namespace Goetas\Mail\ToSwiftMailParser\Mime;
4
5
class ContentDecoder
6
{
7 9
    public function decode(string $string, string $from): string
8
    {
9 9
        if ($from === "base64") {
10 2
            return base64_decode($string);
11 7
        }
12
13 7
        if ($from === "7bit") {
14
            return quoted_printable_decode($string);
15
        }
16 7
17
        if ($from === "quoted-printable") {
18
            return quoted_printable_decode($string);
19
        }
20
21
        return $string;
22
    }
23
}
24