| 1 | <?php |
||
| 9 | final class ForbiddenWordSpamScore implements SpamScoreInterface |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var array<int, string> |
||
| 13 | */ |
||
| 14 | private $words; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $pointsPerMatchedWord; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param array<int, string> $words |
||
| 23 | * @param int $pointsPerMatchedWord |
||
| 24 | */ |
||
| 25 | 7 | public function __construct(array $words, int $pointsPerMatchedWord) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @param MessageInterface $message |
||
| 33 | * @return int |
||
| 34 | */ |
||
| 35 | 5 | public function calculate(MessageInterface $message): int |
|
| 47 | } |
||
| 48 |