Skip to content

Instantly share code, notes, and snippets.

@bedeabza
Created October 10, 2012 14:42
Show Gist options
  • Save bedeabza/3866063 to your computer and use it in GitHub Desktop.
Save bedeabza/3866063 to your computer and use it in GitHub Desktop.
<?php
class Octi extends Human implements Troll, Fisherman
{
private $cellPhone;
private $fishingStick;
private $trollStack;
protected $brain;
protected $actsAs = array(
'project_manager' => array()
);
public function __wakeup()
{
$this->cellPhone->readMessages();
$this->trollStack = $this->brain->thinkAboutHowToTrollColt();
}
public function __call($method, array $params)
{
switch($method){
case 'hearing':
if($params[0] == 'Coltz leaving for a smoke'){
$this->startInfiniteTrollLoop();
}
break;
}
}
protected function startInfiniteTrollLoop()
{
while(count($this->trollStack)){
$this->troll(array_pop($this->trollStack));
}
$this->__sleep();
}
protected function troll($message)
{
echo 'Coltz!!: ' . $message;
}
public function __sleep()
{
$this->__wakeup();
}
//@todo
//implement Fisherman interface
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment