code refactoring

- improved comparing & checking
- improved string composition
This commit is contained in:
Steffen Schröder
2014-06-14 14:32:29 +02:00
parent bd6e0b5151
commit 9985b814d2
41 changed files with 337 additions and 318 deletions

View File

@ -153,7 +153,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
}
}
if ($player && $login == 'lj') {
if ($player && strtolower($login) === 'lj') {
return $player->nickname;
}
@ -417,7 +417,7 @@ class ChatMessagePlugin implements CommandListener, Plugin {
try {
$this->maniaControl->client->spectatorReleasePlayerSlot($player->login);
} catch (Exception $e) {
if ($e->getMessage() != 'The player is not a spectator') {
if ($e->getMessage() !== 'The player is not a spectator') {
$this->maniaControl->errorHandler->triggerDebugNotice("ChatMessagePlugin Debug Line " . $e->getLine() . ": " . $e->getMessage());
// TODO: only possible valid exception should be "wrong login" - throw others (like connection error)
//to nothing