Marlinc/IRCBot — Issue #2: Responses.php (Handlers) doesn't follow Liskov Principle
Author: Snicksie
Created: 2011-12-06 08:27:18+00:00
State: open

https://github.com/Marlinc/IRCBot/blob/master/Handlers/Responses.php has an if/elseif instanceof structure, for every command there is now. For example like this:

```PHP
raiseEvent('onPing', $command);
}
elseif ($command instanceof IRCBot_Commands_Pong) {
$eventHandler->raiseEvent('onPong', $command);
}
?>
```

Liskov would hate to see things like this, he prefers it this way:

```PHP
raiseEvent($command->getEventName(), $command);

class IRCBot_Commands_Ping extends IRCBot_Commands
{
public function getEventName()
{
return "onPing";
}
?>
```