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

@ -60,7 +60,7 @@ class HelpManager implements CommandListener, CallbackListener {
$showCommands = array();
$registeredMethods = array();
foreach (array_reverse($this->adminCommands) as $command) {
if (array_key_exists($command['Method'], $registeredMethods) && $showCommands[$registeredMethods[$command['Method']]]['Description'] == $command['Description']) {
if (array_key_exists($command['Method'], $registeredMethods) && $showCommands[$registeredMethods[$command['Method']]]['Description'] === $command['Description']) {
$name = $registeredMethods[$command['Method']];
$showCommands[$name]['Name'] .= '|' . $command['Name'];
} else {
@ -91,7 +91,7 @@ class HelpManager implements CommandListener, CallbackListener {
$showCommands = array();
$registeredMethods = array();
foreach (array_reverse($this->playerCommands) as $command) {
if (array_key_exists($command['Method'], $registeredMethods) && $showCommands[$registeredMethods[$command['Method']]]['Description'] == $command['Description']) {
if (array_key_exists($command['Method'], $registeredMethods) && $showCommands[$registeredMethods[$command['Method']]]['Description'] === $command['Description']) {
$name = $registeredMethods[$command['Method']];
$showCommands[$name]['Name'] .= '|' . $command['Name'];
} else {
@ -133,7 +133,7 @@ class HelpManager implements CommandListener, CallbackListener {
$registeredMethods = array();
foreach (array_reverse($commands) as $command) {
if (array_key_exists($command['Method'], $registeredMethods)) {
if ($showCommands[$registeredMethods[$command['Method']]]['Description'] == $command['Description']) {
if ($showCommands[$registeredMethods[$command['Method']]]['Description'] === $command['Description']) {
$name = $registeredMethods[$command['Method']];
$showCommands[$name]['Name'] .= '|' . $command['Name'];
} else {
@ -204,7 +204,7 @@ class HelpManager implements CommandListener, CallbackListener {
$pageFrame->add($playerFrame);
$playerFrame->setY($y);
if ($i % 2 != 0) {
if ($i % 2 !== 0) {
$lineQuad = new Quad_BgsPlayerCard();
$playerFrame->add($lineQuad);
$lineQuad->setSize($width, 4);