Last active
June 13, 2019 20:32
-
-
Save Maksclub/b984fc582d6747b45880e56560a8b920 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 EmailSender implements SenderInterface | |
{ | |
# prev behavior | |
public function accept(Visitor $visitor) | |
{ | |
$visitor->visitSenderEmail($this); | |
} | |
} | |
class SmsSender implements SenderInterface | |
{ | |
# prev behavior | |
public function accept(Visitor $visitor) | |
{ | |
$visitor->visitSmsSender($this); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment