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

SimpleCanonicalizeBody::canonicalize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 8
c 0
b 0
f 0
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 6
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
}