@@ -227,7 +227,7 @@ |
||
| 227 | 227 | * |
| 228 | 228 | * @throws Exception |
| 229 | 229 | */ |
| 230 | - protected function parsePlayerTeam($dataType, Buffer &$buffer, Result &$result) |
|
| 230 | + protected function parsePlayerTeam($dataType, Buffer & $buffer, Result & $result) |
|
| 231 | 231 | { |
| 232 | 232 | |
| 233 | 233 | // Do count |
@@ -191,7 +191,7 @@ |
||
| 191 | 191 | $result->addSub('mods', 'steam_id', $responseBuffer->readInt32($infoByte & 0x0F)); |
| 192 | 192 | |
| 193 | 193 | // Read the name of the mod |
| 194 | - $result->addSub('mods', 'name', $responseBuffer->readPascalString(0, true) ?: 'Unknown'); |
|
| 194 | + $result->addSub('mods', 'name', $responseBuffer->readPascalString(0, true) ? : 'Unknown'); |
|
| 195 | 195 | |
| 196 | 196 | --$modCount; |
| 197 | 197 | } |
@@ -147,16 +147,16 @@ |
||
| 147 | 147 | |
| 148 | 148 | $result->add('edition', $info[0]); |
| 149 | 149 | $result->add('motd_line_1', $info[1]); |
| 150 | - $result->add('protocol_version', (int)$info[2]); |
|
| 150 | + $result->add('protocol_version', (int) $info[2]); |
|
| 151 | 151 | $result->add('version', $info[3]); |
| 152 | - $result->add('num_players', (int)$info[4]); |
|
| 153 | - $result->add('max_players', (int)$info[5]); |
|
| 152 | + $result->add('num_players', (int) $info[4]); |
|
| 153 | + $result->add('max_players', (int) $info[5]); |
|
| 154 | 154 | $result->add('server_uid', $info[6]); |
| 155 | 155 | $result->add('motd_line_2', $info[7]); |
| 156 | 156 | $result->add('gamemode', $info[8]); |
| 157 | - $result->add('gamemode_numeric', (int)$info[9]); |
|
| 158 | - $result->add('port_ipv4', (isset($info[10])) ? (int)$info[10] : null); |
|
| 159 | - $result->add('port_ipv6', (isset($info[11])) ? (int)$info[11] : null); |
|
| 157 | + $result->add('gamemode_numeric', (int) $info[9]); |
|
| 158 | + $result->add('port_ipv4', (isset($info[10])) ? (int) $info[10] : null); |
|
| 159 | + $result->add('port_ipv6', (isset($info[11])) ? (int) $info[11] : null); |
|
| 160 | 160 | $result->add('dedicated', 1); |
| 161 | 161 | |
| 162 | 162 | unset($header, $serverGUID, $magicCheck, $info); |
@@ -109,9 +109,9 @@ |
||
| 109 | 109 | // We match one of the keys we are wanting to convert so add it and move on |
| 110 | 110 | $result[sprintf(self::RESULT_KEY, $key)] = sprintf( |
| 111 | 111 | "%02d:%02d:%02d", |
| 112 | - (int)floor($value / 3600), // Hours |
|
| 113 | - (int)fmod(($value / 60), 60), // Minutes |
|
| 114 | - (int)fmod($value, 60) // Seconds |
|
| 112 | + (int) floor($value / 3600), // Hours |
|
| 113 | + (int) fmod(($value / 60), 60), // Minutes |
|
| 114 | + (int) fmod($value, 60) // Seconds |
|
| 115 | 115 | ); |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | public function apply(array $result, Server $server) |
| 51 | 51 | { |
| 52 | 52 | /* Prevent working on empty results */ |
| 53 | - if (! empty($result)) { |
|
| 53 | + if (!empty($result)) { |
|
| 54 | 54 | /* Handle unit test data generation */ |
| 55 | 55 | if ($this->writeTestData) { |
| 56 | 56 | /* Initialize potential data for unit testing **/ |
@@ -192,12 +192,12 @@ |
||
| 192 | 192 | $serverFlags = $buffer->readInt8(); |
| 193 | 193 | |
| 194 | 194 | // Read server flags |
| 195 | - $result->add('password', (int)$this->readFlag($serverFlags, 0)); |
|
| 196 | - $result->add('registered_only', (int)$this->readFlag($serverFlags, 1)); |
|
| 197 | - $result->add('fog_of_war', (int)$this->readFlag($serverFlags, 2)); |
|
| 198 | - $result->add('friendly_fire', (int)$this->readFlag($serverFlags, 3)); |
|
| 199 | - $result->add('bots_enabled', (int)$this->readFlag($serverFlags, 5)); |
|
| 200 | - $result->add('lua_scripts', (int)$this->readFlag($serverFlags, 6)); |
|
| 195 | + $result->add('password', (int) $this->readFlag($serverFlags, 0)); |
|
| 196 | + $result->add('registered_only', (int) $this->readFlag($serverFlags, 1)); |
|
| 197 | + $result->add('fog_of_war', (int) $this->readFlag($serverFlags, 2)); |
|
| 198 | + $result->add('friendly_fire', (int) $this->readFlag($serverFlags, 3)); |
|
| 199 | + $result->add('bots_enabled', (int) $this->readFlag($serverFlags, 5)); |
|
| 200 | + $result->add('lua_scripts', (int) $this->readFlag($serverFlags, 6)); |
|
| 201 | 201 | |
| 202 | 202 | // Read the rest of the buffer data |
| 203 | 203 | $result->add('servername', static::isoToUtf8($buffer->readPascalString(0))); |