for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Genkgo\Mail\Protocol\Smtp\GreyList;
use Genkgo\Mail\MessageInterface;
use Genkgo\Mail\Protocol\Smtp\GreyListInterface;
/**
* Class ArrayGreyList
* @package Genkgo\Mail\Protocol\Smtp\GreyList
*/
final class ArrayGreyList implements GreyListInterface
{
* @var array
private $list = [];
* @param MessageInterface $message
* @return bool
public function contains(MessageInterface $message): bool
$hash = hash('sha256', (string)$message);
return isset($this->list[$hash]);
}
public function attach(MessageInterface $message): void
$this->list[$hash] = true;
public function detach(MessageInterface $message): void
unset($this->list[$hash]);