Completed
Pull Request — master (#18)
by Frederik
01:29
created

SimpleCanonicalizeBody   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
ccs 0
cts 7
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A canonicalize() 0 8 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Header\Dkim;
5
6
final class SimpleCanonicalizeBody implements CanonicalizeBodyInterface
0 ignored issues
show
Bug introduced by
There is one abstract method getName in this class; you could implement it, or declare this class as abstract.
Loading history...
7
{
8
    /**
9
     * @param string $string
10
     * @return string
11
     */
12
    public function canonicalize(string $string): string
13
    {
14
        if (substr($string, -2, 2) === "\r\n") {
15
            return $string . "\r\n";
16
        }
17
18
        return $string;
19
    }
20
}