Last active
June 13, 2019 20:53
-
-
Save Maksclub/3129c6b14faf294d6e912b10349699c5 to your computer and use it in GitHub Desktop.
Конкретный посетитель
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SecretVisitor implements Visitor | |
{ | |
public function visitEmailSender(EmailSender $emailSender) | |
{ | |
# Отправляем сообщение о том, что есть некое секретное сообщение в кабинете | |
} | |
public function visitSmsSender(SmsSender $smsSender) | |
{ | |
# Отправляем СМС нескольким директорам | |
} | |
public function visitAmpqSender(SmsSender $smsSender) | |
{ | |
# Отправляем уведомление через пару специфичных очередей | |
} | |
} | |
# Посетителей может быть несколько | |
class superPuperVisitor implements Visitor | |
{ | |
public function visitEmailSender(EmailSender $emailSender) | |
{ | |
# Отправляем сообщение без контактных данных | |
} | |
public function visitSmsSender(SmsSender $smsSender) | |
{ | |
# Отправляем СМС в полицию | |
} | |
public function visitAmpqSender(SmsSender $smsSender) | |
{ | |
# Отправляем уведомление президенту | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment