@@ -44,7 +44,7 @@ |
||
| 44 | 44 | // Find all services to display configs. |
| 45 | 45 | $definition = $container->getDefinition(ConfigUiManager::class); |
| 46 | 46 | $services = $this->findAndSortTaggedServices('expansion.config.ui', $container); |
| 47 | - foreach($services as $service) { |
|
| 47 | + foreach ($services as $service) { |
|
| 48 | 48 | $definition->addMethodCall( |
| 49 | 49 | 'registerUi', |
| 50 | 50 | [$service] |
@@ -81,9 +81,9 @@ |
||
| 81 | 81 | |
| 82 | 82 | $logMessage = $this->chatNotification->getMessage($this->chatMessage, |
| 83 | 83 | ['%adminLevel%' => $group, '%admin%' => $nickName, "%parameter%" => $parameter], "en"); |
| 84 | - $this->logger->info("[". $login. "] " . TMString::trimStyles($logMessage)); |
|
| 84 | + $this->logger->info("[".$login."] ".TMString::trimStyles($logMessage)); |
|
| 85 | 85 | |
| 86 | - } catch (DedicatedException $e) { |
|
| 86 | + } catch (DedicatedException $e) { |
|
| 87 | 87 | $this->logger->error("Error on admin command", ["exception" => $e]); |
| 88 | 88 | $this->chatNotification->sendMessage("expansion_admin_chat.dedicatedexception", $login, |
| 89 | 89 | ["%message%" => $e->getMessage()]); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | ['%adminLevel%' => $group, '%admin%' => $nickName, "%parameter%" => $parameter], "en"); |
| 84 | 84 | $this->logger->info("[". $login. "] " . TMString::trimStyles($logMessage)); |
| 85 | 85 | |
| 86 | - } catch (DedicatedException $e) { |
|
| 86 | + } catch (DedicatedException $e) { |
|
| 87 | 87 | $this->logger->error("Error on admin command", ["exception" => $e]); |
| 88 | 88 | $this->chatNotification->sendMessage("expansion_admin_chat.dedicatedexception", $login, |
| 89 | 89 | ["%message%" => $e->getMessage()]); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - $uniqueId = uniqid('exp_',true); |
|
| 64 | + $uniqueId = uniqid('exp_', true); |
|
| 65 | 65 | $this->checkVariable = new Variable('check', 'Text', 'This', "\"$uniqueId\""); |
| 66 | 66 | $this->checkOldVariable = new Variable('check_old', 'Text', 'Page', "\"$uniqueId\""); |
| 67 | 67 | } |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | if ($this->variables[$variable]->getValue() != $newValue) { |
| 78 | 78 | $this->variables[$variable]->setValue($newValue); |
| 79 | - $uniqueId = '"' . uniqid('exp_', true) . '"'; |
|
| 79 | + $uniqueId = '"'.uniqid('exp_', true).'"'; |
|
| 80 | 80 | $this->checkVariable->setValue($uniqueId); |
| 81 | 81 | |
| 82 | 82 | if (is_null($this->queuedForUpdate)) { |
@@ -135,16 +135,16 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $scriptContent = ''; |
| 137 | 137 | foreach ($this->variables as $variable) { |
| 138 | - $scriptContent .= $variable->getScriptDeclaration() . "\n"; |
|
| 138 | + $scriptContent .= $variable->getScriptDeclaration()."\n"; |
|
| 139 | 139 | if ($defaultValues) { |
| 140 | - $scriptContent .= $variable->getScriptValueSet() . "\n"; |
|
| 140 | + $scriptContent .= $variable->getScriptValueSet()."\n"; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | - $scriptContent .= $this->checkVariable->getScriptDeclaration() . "\n"; |
|
| 144 | - $scriptContent .= $this->checkOldVariable->getScriptDeclaration() . "\n"; |
|
| 143 | + $scriptContent .= $this->checkVariable->getScriptDeclaration()."\n"; |
|
| 144 | + $scriptContent .= $this->checkOldVariable->getScriptDeclaration()."\n"; |
|
| 145 | 145 | if ($defaultValues) { |
| 146 | - $scriptContent .= $this->checkVariable->getScriptValueSet() . "\n"; |
|
| 147 | - $scriptContent .= $this->checkOldVariable->getVariableName() . ' = "";'; |
|
| 146 | + $scriptContent .= $this->checkVariable->getScriptValueSet()."\n"; |
|
| 147 | + $scriptContent .= $this->checkOldVariable->getVariableName().' = "";'; |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | return $scriptContent; |
@@ -388,7 +388,7 @@ |
||
| 388 | 388 | * Remove special characters from map name |
| 389 | 389 | * |
| 390 | 390 | * @param string $string |
| 391 | - * @return mixed |
|
| 391 | + * @return string |
|
| 392 | 392 | */ |
| 393 | 393 | protected function cleanString($string) |
| 394 | 394 | { |
@@ -87,6 +87,9 @@ |
||
| 87 | 87 | return $this; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @param string $textId |
|
| 92 | + */ |
|
| 90 | 93 | public function setTextId($textId) |
| 91 | 94 | { |
| 92 | 95 | $this->setText($textId); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $configs = [ |
| 184 | 184 | 'global' => $this->globalConfigurations, |
| 185 | 185 | 'key' => $this->keyConfigurations, |
| 186 | - 'server-' . $this->gameDataStorage->getSystemInfo()->serverLogin => $this->serverConfigurations, |
|
| 186 | + 'server-'.$this->gameDataStorage->getSystemInfo()->serverLogin => $this->serverConfigurations, |
|
| 187 | 187 | ]; |
| 188 | 188 | |
| 189 | 189 | foreach ($configs as $filekey => $config) { |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $configs = [ |
| 212 | 212 | 'global' => $this->globalConfigurations, |
| 213 | 213 | 'key' => $this->keyConfigurations, |
| 214 | - 'server-' . $this->gameDataStorage->getSystemInfo()->serverLogin => $this->serverConfigurations, |
|
| 214 | + 'server-'.$this->gameDataStorage->getSystemInfo()->serverLogin => $this->serverConfigurations, |
|
| 215 | 215 | ]; |
| 216 | 216 | |
| 217 | 217 | foreach ($configs as $filekey => $config) { |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | ); |
| 222 | 222 | |
| 223 | 223 | // TODO get only non default values. |
| 224 | - $encoded = json_encode($config->getArray(), JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT); |
|
| 224 | + $encoded = json_encode($config->getArray(), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT); |
|
| 225 | 225 | $this->filesystem->put("config-$filekey.json", $encoded); |
| 226 | 226 | } |
| 227 | 227 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $frame = new Frame(); |
| 38 | 38 | |
| 39 | 39 | $descriptionButton = $this->uiFactory->createButton("?"); |
| 40 | - $rowLayout = $this->uiFactory->createLayoutLine( |
|
| 40 | + $rowLayout = $this->uiFactory->createLayoutLine( |
|
| 41 | 41 | 0, |
| 42 | 42 | 0, |
| 43 | 43 | [ |
@@ -73,9 +73,9 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | foreach ($configItems as $configId => $configItem) { |
| 75 | 75 | $subItems = reset($configItem); |
| 76 | - $path = $parentId . '/' . $configId; |
|
| 77 | - $configPath = str_replace("admin/server/config/",'', $path); |
|
| 78 | - $translationKey = 'expansion_config.menu.' . implode('.', explode('/', $configPath)) . '.label'; |
|
| 76 | + $path = $parentId.'/'.$configId; |
|
| 77 | + $configPath = str_replace("admin/server/config/", '', $path); |
|
| 78 | + $translationKey = 'expansion_config.menu.'.implode('.', explode('/', $configPath)).'.label'; |
|
| 79 | 79 | |
| 80 | 80 | if (is_array($subItems)) { |
| 81 | 81 | $root->addChild( |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | $path, |
| 93 | 93 | $translationKey, |
| 94 | 94 | null, |
| 95 | - ['cmd' => '/admin config "' . $configPath . '"'] |
|
| 95 | + ['cmd' => '/admin config "'.$configPath.'"'] |
|
| 96 | 96 | ); |
| 97 | 97 | } |
| 98 | 98 | } |