protected function handle(NotificationInterface $notification, NotificationHandlerInterface $handler): bool
    {
        if (! $handler->supports($notification)) {
            return false;
        }

        $cloned = clone $notification;

        $event = new NotifyEvent($cloned, $handler);
        $this->eventDispatcher->dispatch(Events::NOTIFY, $event);

        $handler->notify($cloned);

        foreach ($cloned->getResultSet()->all() as $result) {
            $notification->addResult($result);
        }

        return true;
    }
protected function handle(NotificationInterface $notification, NotificationHandlerInterface $handler): bool
    {
        if (! $handler->supports($notification)) {
            return false;
        }

        $cloned = clone $notification;

        $event = new NotifyEvent($cloned, $handler);
        $this->eventDispatcher->dispatch(Events::NOTIFY, $event);

        $handler->notify($cloned);

        foreach ($cloned->getResultSet()->all() as $result) {
            $notification->addResult($result);
        }

        return true;
    }
protected function handle ( NotificationInterface $ notification , NotificationHandlerInterface $ handler ) : bool { if ( ! $ handler -> supports ( $ notification ) ) { return false ; } $ cloned = clone $ notification ; $ event = new NotifyEvent ( $ cloned , $ handler ) ; $ this -> eventDispatcher -> dispatch ( Events :: NOTIFY , $ event ) ; $ handler -> notify ( $ cloned ) ; foreach ( $ cloned -> getResultSet ( ) -> all ( ) as $ result ) { $ notification -> addResult ( $ result ) ; } return true ; }
Checks if handler supports this notification and eventually
send the notification.

@param NotificationInterface        $notification
@param NotificationHandlerInterface $handler

@return bool
Checks if handler supports this notification and eventually send the notification .