Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class AwsSesBounceComplaintHandler |
||
9 | { |
||
10 | 3 | public function canSendToEmail(string $email): bool |
|
25 | } |
||
26 | |||
27 | 1 | public function ignoreEmail(string $email): void |
|
28 | { |
||
29 | /** @var WrongEmail[]|Collection $emails */ |
||
30 | 1 | $emails = WrongEmail::where('email', '=', $email)->get(); |
|
31 | |||
32 | 1 | foreach ($emails as $wrongEmail) { |
|
33 | 1 | $wrongEmail->ignore = true; |
|
|
|||
34 | 1 | $wrongEmail->save(); |
|
35 | } |
||
36 | 1 | } |
|
37 | |||
38 | 1 | public function clearEmail(string $email): void |
|
42 | 1 | } |
|
43 | } |
||
44 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.