Skip to content

Instantly share code, notes, and snippets.

@shinderuman
Forked from anonymous/ConcertHall.php
Last active August 29, 2015 14:23
Show Gist options
  • Save shinderuman/70f860c33243884b9355 to your computer and use it in GitHub Desktop.
Save shinderuman/70f860c33243884b9355 to your computer and use it in GitHub Desktop.
class ConcertHall
{
public function convert(Human $human)
{
$audience = new Xxxv($human);
echo $audience->say()->toString(); // 'Xxxv!!!!!'
}
}
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