for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace ag84ark\AwsSesBounceComplaintHandler;
use ag84ark\AwsSesBounceComplaintHandler\Models\WrongEmail;
use Illuminate\Support\Collection;
class AwsSesBounceComplaintHandler
{
public function canSendToEmail(string $email): bool
/** @var WrongEmail[]|Collection $emails */
$emails = WrongEmail::active()
->bounced()
->where('email', '=', $email)
->get();
foreach ($emails as $wrongEmail) {
if (! $wrongEmail->canBouncedSend()) {
return false;
}
return true;
public function ignoreEmail(string $email): void
$emails = WrongEmail::where('email', '=', $email)->get();
$wrongEmail->ignore = true;
$ignore
integer
true
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.
$answer = 42; $correct = false; $correct = (bool) $answer;
$wrongEmail->save();
public function clearEmail(string $email): void
/* @var WrongEmail[]|Collection $emails */
WrongEmail::where('email', '=', $email)->delete();
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.