coding & phpdoc improvements
This commit is contained in:
		| @@ -71,15 +71,15 @@ class ManiaExchangeManager { | |||||||
| 	/** | 	/** | ||||||
| 	 * Fetch Map Information from Mania Exchange | 	 * Fetch Map Information from Mania Exchange | ||||||
| 	 * | 	 * | ||||||
| 	 * @param null $map | 	 * @param mixed $maps | ||||||
| 	 */ | 	 */ | ||||||
| 	public function fetchManiaExchangeMapInformation($map = null) { | 	public function fetchManiaExchangeMapInformation($maps = null) { | ||||||
| 		if (!$map) { | 		if (!$maps) { | ||||||
| 			//Fetch Information for whole MapList | 			//Fetch Information for whole MapList | ||||||
| 			$maps = $this->maniaControl->mapManager->getMaps(); | 			$maps = $this->maniaControl->mapManager->getMaps(); | ||||||
| 		} else { | 		} else { | ||||||
| 			//Fetch Information for a single map | 			//Fetch Information for a single map | ||||||
| 			$maps[] = $map; | 			$maps = (array)$maps; | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
| 		$mysqli      = $this->maniaControl->database->mysqli; | 		$mysqli      = $this->maniaControl->database->mysqli; | ||||||
|   | |||||||
| @@ -113,13 +113,12 @@ class MapCommands implements CommandListener, ManialinkPageAnswerListener, Callb | |||||||
| 			$requester = $nextQueued[0]; | 			$requester = $nextQueued[0]; | ||||||
| 			/** @var Map $map */ | 			/** @var Map $map */ | ||||||
| 			$map = $nextQueued[1]; | 			$map = $nextQueued[1]; | ||||||
| 			$this->maniaControl->chat->sendInformation("Next map is $<" . $map->name . "$> from $<" . $map->authorNick . "$> requested by $<" . $requester->nickname . "$>.", $player); | 			$this->maniaControl->chat->sendInformation("Next Map is $<{$map->nam}$> from $<{$map->authorNick}$> requested by $<{$requester->nickname}$>.", $player); | ||||||
| 		} else { | 		} else { | ||||||
|  |  | ||||||
| 			$mapIndex = $this->maniaControl->client->getNextMapIndex(); | 			$mapIndex = $this->maniaControl->client->getNextMapIndex(); | ||||||
| 			$maps     = $this->maniaControl->mapManager->getMaps(); | 			$maps     = $this->maniaControl->mapManager->getMaps(); | ||||||
| 			$map      = $maps[$mapIndex]; | 			$map      = $maps[$mapIndex]; | ||||||
| 			$this->maniaControl->chat->sendInformation("Next map is $<" . $map->name . "$> from $<" . $map->authorNick . "$>.", $player->login); | 			$this->maniaControl->chat->sendInformation("Next Map is $<{$map->name}$> from $<{$map->authorNick}$>.", $player); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -110,7 +110,7 @@ class MapList implements ManialinkPageAnswerListener, CallbackListener { | |||||||
| 	 * Display a MapList on the Screen | 	 * Display a MapList on the Screen | ||||||
| 	 * | 	 * | ||||||
| 	 * @param Player $player | 	 * @param Player $player | ||||||
| 	 * @param array  $mapList | 	 * @param Map[]  $mapList | ||||||
| 	 * @param int    $pageIndex | 	 * @param int    $pageIndex | ||||||
| 	 */ | 	 */ | ||||||
| 	public function showMapList(Player $player, $mapList = null, $pageIndex = -1) { | 	public function showMapList(Player $player, $mapList = null, $pageIndex = -1) { | ||||||
|   | |||||||
| @@ -581,8 +581,7 @@ class MapManager implements CallbackListener { | |||||||
| 	 * Returns the MapIndex of a given map | 	 * Returns the MapIndex of a given map | ||||||
| 	 * | 	 * | ||||||
| 	 * @param Map $map | 	 * @param Map $map | ||||||
| 	 * @internal param $uid | 	 * @return int | ||||||
| 	 * @return mixed |  | ||||||
| 	 */ | 	 */ | ||||||
| 	public function getMapIndex(Map $map) { | 	public function getMapIndex(Map $map) { | ||||||
| 		$maps = $this->getMaps(); | 		$maps = $this->getMaps(); | ||||||
| @@ -594,7 +593,7 @@ class MapManager implements CallbackListener { | |||||||
| 	 * | 	 * | ||||||
| 	 * @param int $offset | 	 * @param int $offset | ||||||
| 	 * @param int $length | 	 * @param int $length | ||||||
| 	 * @return array | 	 * @return Map[] | ||||||
| 	 */ | 	 */ | ||||||
| 	public function getMaps($offset = null, $length = null) { | 	public function getMaps($offset = null, $length = null) { | ||||||
| 		if ($offset === null) { | 		if ($offset === null) { | ||||||
|   | |||||||
| @@ -193,7 +193,9 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener { | |||||||
|  |  | ||||||
| 				break; | 				break; | ||||||
| 			case self::RANKING_TYPE_RECORDS: //TODO verify workable status | 			case self::RANKING_TYPE_RECORDS: //TODO verify workable status | ||||||
| 				if (!$this->maniaControl->pluginManager->isPluginActive(__NAMESPACE__ . '\LocalRecordsPlugin')) { | 				/** @var LocalRecordsPlugin $localRecordsPlugin */ | ||||||
|  | 				$localRecordsPlugin = $this->maniaControl->pluginManager->getPlugin(__NAMESPACE__ . '\LocalRecordsPlugin'); | ||||||
|  | 				if (!$localRecordsPlugin) { | ||||||
| 					return; | 					return; | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
| @@ -212,9 +214,7 @@ class ServerRankingPlugin implements Plugin, CallbackListener, CommandListener { | |||||||
| 				} | 				} | ||||||
| 				$result->free_result(); | 				$result->free_result(); | ||||||
|  |  | ||||||
| 				/** @var LocalRecordsPlugin $localRecordsPlugin */ | 				$maps = $this->maniaControl->mapManager->getMaps(); | ||||||
| 				$localRecordsPlugin = $this->maniaControl->pluginManager->getPlugin(__NAMESPACE__ . '\LocalRecordsPlugin'); |  | ||||||
| 				$maps               = $this->maniaControl->mapManager->getMaps(); |  | ||||||
| 				foreach ($maps as $map) { | 				foreach ($maps as $map) { | ||||||
| 					$records = $localRecordsPlugin->getLocalRecords($map, $maxRecords); | 					$records = $localRecordsPlugin->getLocalRecords($map, $maxRecords); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user