try to fix dedimania php notice

This commit is contained in:
kremsy 2015-01-12 13:33:40 +01:00
parent 2d942c58fe
commit f2948c1a0c

View File

@ -405,8 +405,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
return null; return null;
} }
switch ($gameMode) { switch ($gameMode) {
case 0: case 0: {
{
$scriptNameResponse = $this->maniaControl->getClient()->getScriptName(); $scriptNameResponse = $this->maniaControl->getClient()->getScriptName();
$scriptName = str_replace('.Script.txt', '', $scriptNameResponse['CurrentValue']); $scriptName = str_replace('.Script.txt', '', $scriptNameResponse['CurrentValue']);
switch ($scriptName) { switch ($scriptName) {
@ -424,13 +423,11 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
} }
case 1: case 1:
case 3: case 3:
case 5: case 5: {
{
return 'Rounds'; return 'Rounds';
} }
case 2: case 2:
case 4: case 4: {
{
return 'TA'; return 'TA';
} }
} }
@ -848,7 +845,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
* @param RecordCallback $callback * @param RecordCallback $callback
*/ */
public function handleFinishCallback(RecordCallback $callback) { public function handleFinishCallback(RecordCallback $callback) {
if (!$this->dedimaniaData || !$this->dedimaniaData->records) { if ($this->dedimaniaData != null || !$this->dedimaniaData->records) {
return; return;
} }
if ($callback->isLegacyCallback) { if ($callback->isLegacyCallback) {
@ -907,7 +904,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
* @return RecordData $record * @return RecordData $record
*/ */
private function getDedimaniaRecord($login) { private function getDedimaniaRecord($login) {
if (!$this->dedimaniaData || !$this->dedimaniaData->records) { if ($this->dedimaniaData != null || !$this->dedimaniaData->records) {
return new RecordData(null); return new RecordData(null);
} }
$records = $this->dedimaniaData->records; $records = $this->dedimaniaData->records;
@ -948,7 +945,7 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
* @return bool * @return bool
*/ */
private function insertDedimaniaRecord(RecordData &$newRecord, RecordData $oldRecord) { private function insertDedimaniaRecord(RecordData &$newRecord, RecordData $oldRecord) {
if (!$this->dedimaniaData || !$this->dedimaniaData->records || $newRecord->nullRecord) { if ($this->dedimaniaData != null || !$this->dedimaniaData->records || $newRecord->nullRecord) {
return false; return false;
} }