@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function onPlayerConnect(Player $player) |
| 46 | 46 | { |
| 47 | - $msg = '$fffHello, ' . $player->getNickName() . ' $n$fff($888' . $player->getLogin() . '$fff)'; |
|
| 47 | + $msg = '$fffHello, '.$player->getNickName().' $n$fff($888'.$player->getLogin().'$fff)'; |
|
| 48 | 48 | $this->sendChat($msg); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function onPlayerDisconnect(Player $player, $disconnectionReason) |
| 55 | 55 | { |
| 56 | - $msg = '$fffSee you, ' . $player->getNickName() . ' $n$fff($888' . $player->getLogin() . '$fff)'; |
|
| 56 | + $msg = '$fffSee you, '.$player->getNickName().' $n$fff($888'.$player->getLogin().'$fff)'; |
|
| 57 | 57 | $this->sendChat($msg); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | * BasicEmote constructor. |
| 29 | 29 | * |
| 30 | 30 | * @param string $command The chat command |
| 31 | - * @param string $message The emote message to send |
|
| 31 | + * @param string $nbMessages The emote message to send |
|
| 32 | 32 | * @param ChatNotification $chatNotification |
| 33 | 33 | * @param array $aliases |
| 34 | 34 | * @param bool $parametersAsArray |
@@ -45,8 +45,8 @@ |
||
| 45 | 45 | $this->chatNotification = $chatNotification; |
| 46 | 46 | $this->playerStorage = $playerStorage; |
| 47 | 47 | |
| 48 | - for($i = 1; $i <= $nbMessages; $i++) { |
|
| 49 | - $this->messages[] = "expansion_emotes.$command" . $i; |
|
| 48 | + for ($i = 1; $i <= $nbMessages; $i++) { |
|
| 49 | + $this->messages[] = "expansion_emotes.$command".$i; |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
@@ -93,12 +93,12 @@ |
||
| 93 | 93 | |
| 94 | 94 | public function onPreLoop() |
| 95 | 95 | { |
| 96 | - // do nothing |
|
| 96 | + // do nothing |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | public function onPostLoop() |
| 100 | 100 | { |
| 101 | - // do nothing |
|
| 101 | + // do nothing |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @param $login |
| 13 | 13 | * @param $actionId |
| 14 | - * @param array $entryValues |
|
| 15 | 14 | * |
| 16 | 15 | */ |
| 17 | 16 | public function onPlayerManialinkPageAnswer($playerUid, $login, $actionId, array $entries) |
@@ -17,9 +17,9 @@ |
||
| 17 | 17 | public function onPlayerManialinkPageAnswer($playerUid, $login, $actionId, array $entries) |
| 18 | 18 | { |
| 19 | 19 | $entryValues = array(); |
| 20 | - if(count($entries)) |
|
| 20 | + if (count($entries)) |
|
| 21 | 21 | { |
| 22 | - foreach($entries as $entry) { |
|
| 22 | + foreach ($entries as $entry) { |
|
| 23 | 23 | $entryValues[$entry['Name']] = $entry['Value']; |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | * Send message. |
| 51 | 51 | * |
| 52 | 52 | * @param string $messageId |
| 53 | - * @param string|string[]|null $to |
|
| 53 | + * @param null|string $to |
|
| 54 | 54 | * @param string[] $parameters |
| 55 | 55 | */ |
| 56 | 56 | public function sendMessage($messageId, $to = null, $parameters = []) |
@@ -36,13 +36,13 @@ |
||
| 36 | 36 | Translations $translations, |
| 37 | 37 | PlayerStorage $playerStorage, |
| 38 | 38 | $colorCodes |
| 39 | - ){ |
|
| 39 | + ) { |
|
| 40 | 40 | $this->connection = $connection; |
| 41 | 41 | $this->translations = $translations; |
| 42 | 42 | $this->playerStorage = $playerStorage; |
| 43 | 43 | |
| 44 | 44 | foreach ($colorCodes as $code => $colorCode) { |
| 45 | - $this->colorCodes["{" . $code . "}"] = '$z' . $colorCode; |
|
| 45 | + $this->colorCodes["{".$code."}"] = '$z'.$colorCode; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -20,8 +20,6 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * Dispatcher constructor. |
| 22 | 22 | * |
| 23 | - * @param DataProviderManager $dataProviderManager |
|
| 24 | - * @param PluginManager $pluginManager |
|
| 25 | 23 | */ |
| 26 | 24 | public function __construct(Console $console) |
| 27 | 25 | { |
@@ -83,6 +83,10 @@ discard block |
||
| 83 | 83 | return $this->findChatCommand($cmdAndArgs, $this->depth); |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | + /** |
|
| 87 | + * @param string[] $cmdAndArgs |
|
| 88 | + * @param integer $depth |
|
| 89 | + */ |
|
| 86 | 90 | protected function findChatCommand($cmdAndArgs, $depth) |
| 87 | 91 | { |
| 88 | 92 | if ($depth == 0) { |
@@ -100,8 +104,8 @@ discard block |
||
| 100 | 104 | |
| 101 | 105 | /** |
| 102 | 106 | * |
| 103 | - * @param $pluginId |
|
| 104 | - * @param $cmdTxt |
|
| 107 | + * @param string $pluginId |
|
| 108 | + * @param string $cmdTxt |
|
| 105 | 109 | * @param ChatCommandInterface $command |
| 106 | 110 | * |
| 107 | 111 | * @throws CommandExistException |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $commands = $pluginService->getChatCommands(); |
| 47 | 47 | |
| 48 | - foreach($commands as $command) |
|
| 48 | + foreach ($commands as $command) |
|
| 49 | 49 | { |
| 50 | 50 | $this->addCommand($pluginId, $command->getCommand(), $command); |
| 51 | 51 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function deletePlugin($pluginId) |
| 64 | 64 | { |
| 65 | - if(!isset($this->commandPlugin[$pluginId])) { |
|
| 65 | + if (!isset($this->commandPlugin[$pluginId])) { |
|
| 66 | 66 | return; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | return isset($this->commands[$command]) |
| 97 | 97 | ? [$this->commands[$command], $parameters] |
| 98 | - : $this->findChatCommand($cmdAndArgs, $depth-1); |
|
| 98 | + : $this->findChatCommand($cmdAndArgs, $depth - 1); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -115,6 +115,6 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | $this->commands[$cmdTxt] = $command; |
| 118 | - $this->commandPlugin[$pluginId][$cmdTxt] = $command; |
|
| 118 | + $this->commandPlugin[$pluginId][$cmdTxt] = $command; |
|
| 119 | 119 | } |
| 120 | 120 | } |
| 121 | 121 | \ No newline at end of file |
@@ -63,9 +63,9 @@ |
||
| 63 | 63 | /** |
| 64 | 64 | * Enable all possible plugins. |
| 65 | 65 | * |
| 66 | - * @param $title |
|
| 67 | - * @param $mode |
|
| 68 | - * @param $script |
|
| 66 | + * @param string $title |
|
| 67 | + * @param string $mode |
|
| 68 | + * @param string $script |
|
| 69 | 69 | */ |
| 70 | 70 | protected function enableDisablePlugins($title, $mode, $script) |
| 71 | 71 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $this->enablePlugin($plugin); |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - foreach ($pluginsToProcess as $plugin) { |
|
| 94 | + foreach ($pluginsToProcess as $plugin) { |
|
| 95 | 95 | $this->disablePlugin($plugin); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | // Now check for data providers. |
| 121 | 121 | foreach ($plugin->getDataProviders() as $dataProvider) { |
| 122 | - $providerId = $this->dataProviderManager->getCompatibleProviderId($dataProvider, $title, $mode, $script); |
|
| 122 | + $providerId = $this->dataProviderManager->getCompatibleProviderId($dataProvider, $title, $mode, $script); |
|
| 123 | 123 | |
| 124 | 124 | if (is_null($providerId) || !isset($enabledPlugins[$providerId])) { |
| 125 | 125 | // Either there are no data providers compatible or the only one compatible |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | // If data provider need to check if it was "the chosen one". |
| 131 | 131 | if ($plugin->isIsDataProvider()) { |
| 132 | - $selectedProvider = $this->dataProviderManager->getCompatibleProviderId($plugin->getDataProviderName(), $title, $mode, $script); |
|
| 132 | + $selectedProvider = $this->dataProviderManager->getCompatibleProviderId($plugin->getDataProviderName(), $title, $mode, $script); |
|
| 133 | 133 | |
| 134 | 134 | if ($plugin->getPluginId() != $selectedProvider) { |
| 135 | 135 | // This data provider wasn't the one selected and therefore the plugin isn't compatible. |
@@ -500,7 +500,7 @@ |
||
| 500 | 500 | } |
| 501 | 501 | |
| 502 | 502 | /** |
| 503 | - * @param \Maniaplanet\DedicatedServer\Structures\Player|array $data |
|
| 503 | + * @param \Maniaplanet\DedicatedServer\Structures\PlayerInfo $data |
|
| 504 | 504 | * |
| 505 | 505 | * @return $this |
| 506 | 506 | */ |