improved phpdoc var statements
This commit is contained in:
parent
d6405550ee
commit
861f9217b3
@ -27,7 +27,9 @@ class DedimaniaData {
|
|||||||
public $login;
|
public $login;
|
||||||
public $code;
|
public $code;
|
||||||
public $sessionId = '';
|
public $sessionId = '';
|
||||||
|
/** @var RecordData[] $records */
|
||||||
public $records = array();
|
public $records = array();
|
||||||
|
/** @var DedimaniaPlayer[] $players */
|
||||||
public $players = array();
|
public $players = array();
|
||||||
public $directoryAccessChecked = false;
|
public $directoryAccessChecked = false;
|
||||||
public $serverMaxRank = 30;
|
public $serverMaxRank = 30;
|
||||||
|
@ -696,7 +696,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
$times = array();
|
$times = array();
|
||||||
$replays = array();
|
$replays = array();
|
||||||
foreach ($this->dedimaniaData->records as $record) {
|
foreach ($this->dedimaniaData->records as $record) {
|
||||||
/** @var RecordData $record */
|
|
||||||
if ($record->rank > $this->dedimaniaData->serverMaxRank) {
|
if ($record->rank > $this->dedimaniaData->serverMaxRank) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -864,7 +863,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
if ($this->insertDedimaniaRecord($newRecord, $oldRecord)) {
|
if ($this->insertDedimaniaRecord($newRecord, $oldRecord)) {
|
||||||
// Get newly saved record
|
// Get newly saved record
|
||||||
foreach ($this->dedimaniaData->records as &$record) {
|
foreach ($this->dedimaniaData->records as &$record) {
|
||||||
/** @var RecordData $record */
|
|
||||||
if ($record->login !== $newRecord->login) {
|
if ($record->login !== $newRecord->login) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -900,12 +898,11 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
* @return RecordData $record
|
* @return RecordData $record
|
||||||
*/
|
*/
|
||||||
private function getDedimaniaRecord($login) {
|
private function getDedimaniaRecord($login) {
|
||||||
if (!$this->dedimaniaData->records) {
|
if (!$this->dedimaniaData || !$this->dedimaniaData->records) {
|
||||||
return new RecordData(null);
|
return new RecordData(null);
|
||||||
}
|
}
|
||||||
$records = $this->dedimaniaData->records;
|
$records = $this->dedimaniaData->records;
|
||||||
foreach ($records as &$record) {
|
foreach ($records as &$record) {
|
||||||
/** @var RecordData $record */
|
|
||||||
if ($record->login === $login) {
|
if ($record->login === $login) {
|
||||||
return $record;
|
return $record;
|
||||||
}
|
}
|
||||||
@ -954,7 +951,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
|
|
||||||
// Loop through existing records
|
// Loop through existing records
|
||||||
foreach ($this->dedimaniaData->records as $key => &$record) {
|
foreach ($this->dedimaniaData->records as $key => &$record) {
|
||||||
/** @var RecordData $record */
|
|
||||||
if ($record->rank > $maxRank) {
|
if ($record->rank > $maxRank) {
|
||||||
// Max rank reached
|
// Max rank reached
|
||||||
return false;
|
return false;
|
||||||
@ -983,7 +979,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
if ($oldRecord) {
|
if ($oldRecord) {
|
||||||
// Remove old record
|
// Remove old record
|
||||||
foreach ($this->dedimaniaData->records as $key2 => $record2) {
|
foreach ($this->dedimaniaData->records as $key2 => $record2) {
|
||||||
/** @var RecordData $record2 */
|
|
||||||
if ($record2->login !== $oldRecord->login) {
|
if ($record2->login !== $oldRecord->login) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1035,7 +1030,6 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
// Update ranks
|
// Update ranks
|
||||||
$rank = 1;
|
$rank = 1;
|
||||||
foreach ($this->dedimaniaData->records as &$record) {
|
foreach ($this->dedimaniaData->records as &$record) {
|
||||||
/** @var RecordData $record */
|
|
||||||
$record->rank = $rank;
|
$record->rank = $rank;
|
||||||
$rank++;
|
$rank++;
|
||||||
}
|
}
|
||||||
@ -1187,4 +1181,4 @@ class DedimaniaPlugin implements CallbackListener, CommandListener, TimerListene
|
|||||||
*/
|
*/
|
||||||
public function unload() {
|
public function unload() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user