Completed
Push — master ( 5840b0...fcc03f )
by Frederik
04:51
created

FixedSpamScore::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Genkgo\Mail\Protocol\Smtp\SpamScore;
5
6
use Genkgo\Mail\MessageInterface;
7
use Genkgo\Mail\Protocol\Smtp\SpamScoreInterface;
8
9
final class FixedSpamScore implements SpamScoreInterface
10
{
11
    /**
12
     * @var int
13
     */
14
    private $score;
15
16
    /**
17
     * FixedSpamScore constructor.
18
     * @param int $score
19
     */
20 2
    public function __construct(int $score)
21
    {
22 2
        $this->score = $score;
23 2
    }
24
25
    /**
26
     * @param MessageInterface $message
27
     * @return int
28
     */
29 2
    public function calculate(MessageInterface $message): int
30
    {
31 2
        return $this->score;
32
    }
33
}