-
-
Save shinderuman/70f860c33243884b9355 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
class ConcertHall | |
{ | |
public function convert(Human $human) | |
{ | |
$audience = new Xxxv($human); | |
echo $audience->say()->toString(); // 'Xxxv!!!!!' | |
} | |
} |
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
class Xxxv implements Audience | |
{ | |
/** | |
* @var Human | |
*/ | |
private $human; | |
/** | |
* @param Container $container | |
*/ | |
public function __construct(Human $human) | |
{ | |
$this->human = $human; | |
} | |
/** | |
* @return Voice | |
*/ | |
public function say() | |
{ | |
return $this->human->say('Xxxv!!!!!'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment