fix: handler null after variable collision

This commit is contained in:
KHOUBZA Younes
2022-06-12 12:32:54 +01:00
parent 7a0c5ea93f
commit 5498964348
@@ -539,8 +539,9 @@ class NotificationBuilder implements NotificationBuilderInterface
*/
public function handler($handler)
{
$handler = $this->envelope->get('Flasher\Prime\Stamp\HandlerStamp');
if ($handler instanceof HandlerStamp) {
$stamp = $this->envelope->get('Flasher\Prime\Stamp\HandlerStamp');
if ($stamp instanceof HandlerStamp) {
throw new \LogicException('You cannot change the handler of a notification once it has been set.');
}