@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @param \GameQ\Result $result |
| 149 | 149 | * @throws \GameQ\Exception\Protocol |
| 150 | 150 | */ |
| 151 | - protected function processKeyValuePairs(Buffer &$buffer, Result &$result) |
|
| 151 | + protected function processKeyValuePairs(Buffer & $buffer, Result & $result) |
|
| 152 | 152 | { |
| 153 | 153 | // Key / value pairs |
| 154 | 154 | while ($buffer->getLength()) { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * @param \GameQ\Result $result |
| 177 | 177 | * @throws \GameQ\Exception\Protocol |
| 178 | 178 | */ |
| 179 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
| 179 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
| 180 | 180 | { |
| 181 | 181 | // Players and team info |
| 182 | 182 | while ($buffer->getLength()) { |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | * @param \GameQ\Result $result |
| 246 | 246 | * @return void |
| 247 | 247 | */ |
| 248 | - protected function processDetails($data, Result &$result) |
|
| 248 | + protected function processDetails($data, Result & $result) |
|
| 249 | 249 | { |
| 250 | 250 | // Offload the parsing for these values |
| 251 | 251 | $properties = $this->processProperties($data); |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * @param \GameQ\Result $result |
| 275 | 275 | * @return void |
| 276 | 276 | */ |
| 277 | - protected function processChannels($data, Result &$result) |
|
| 277 | + protected function processChannels($data, Result & $result) |
|
| 278 | 278 | { |
| 279 | 279 | // We need to split the data at the pipe |
| 280 | 280 | $channels = explode('|', $data); |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | * @param \GameQ\Result $result |
| 301 | 301 | * @return void |
| 302 | 302 | */ |
| 303 | - protected function processPlayers($data, Result &$result) |
|
| 303 | + protected function processPlayers($data, Result & $result) |
|
| 304 | 304 | { |
| 305 | 305 | // We need to split the data at the pipe |
| 306 | 306 | $players = explode('|', $data); |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | * @return void |
| 237 | 237 | * @throws \GameQ\Exception\Protocol |
| 238 | 238 | */ |
| 239 | - protected function processDetails(Buffer &$buffer, Result &$result) |
|
| 239 | + protected function processDetails(Buffer & $buffer, Result & $result) |
|
| 240 | 240 | { |
| 241 | 241 | // We go until we hit an empty key |
| 242 | 242 | while ($buffer->getLength()) { |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | * @param \GameQ\Buffer $buffer |
| 255 | 255 | * @param \GameQ\Result $result |
| 256 | 256 | */ |
| 257 | - protected function processPlayersAndTeams(Buffer &$buffer, Result &$result) |
|
| 257 | + protected function processPlayersAndTeams(Buffer & $buffer, Result & $result) |
|
| 258 | 258 | { |
| 259 | 259 | /* |
| 260 | 260 | * Explode the data into groups. First is player, next is team (item_t) |
@@ -218,7 +218,7 @@ |
||
| 218 | 218 | * @throws Exception |
| 219 | 219 | * @throws \GameQ\Exception\Protocol |
| 220 | 220 | */ |
| 221 | - protected function parsePlayerTeam($dataType, Buffer &$buffer, Result &$result) |
|
| 221 | + protected function parsePlayerTeam($dataType, Buffer & $buffer, Result & $result) |
|
| 222 | 222 | { |
| 223 | 223 | // Do count |
| 224 | 224 | $result->add('num_' . $dataType, $buffer->readInt8()); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | * @return array |
| 149 | 149 | * @throws \GameQ\Exception\Protocol |
| 150 | 150 | */ |
| 151 | - protected function parseServerParameters(Buffer &$buffer) |
|
| 151 | + protected function parseServerParameters(Buffer & $buffer) |
|
| 152 | 152 | { |
| 153 | 153 | // Init the parsed data array |
| 154 | 154 | $parsed = []; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // Boolean |
| 192 | 192 | case 5: |
| 193 | - $parsed[$i] = (bool)$buffer->readInt8Signed(); |
|
| 193 | + $parsed[$i] = (bool) $buffer->readInt8Signed(); |
|
| 194 | 194 | break; |
| 195 | 195 | |
| 196 | 196 | // 8-bit int |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function __construct(array $options = []) |
| 61 | 61 | { |
| 62 | 62 | // Check for passed keys |
| 63 | - if (! array_key_exists(self::OPTION_TIMEKEYS, $options)) { |
|
| 63 | + if (!array_key_exists(self::OPTION_TIMEKEYS, $options)) { |
|
| 64 | 64 | // Use default |
| 65 | 65 | $options[self::OPTION_TIMEKEYS] = $this->timeKeysDefault; |
| 66 | 66 | } else { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | (is_numeric($value)) |
| 91 | 91 | ) { |
| 92 | 92 | // Ensure the value is float |
| 93 | - if (! is_float($value)) { |
|
| 93 | + if (!is_float($value)) { |
|
| 94 | 94 | $value = floatval($value); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | // Format the provided time |
| 102 | 102 | sprintf( |
| 103 | 103 | '%02d:%02d:%02d', |
| 104 | - (int)floor($value / 3600), // Hours |
|
| 105 | - (int)fmod(($value / 60), 60), // Minutes |
|
| 106 | - (int)fmod($value, 60) // Seconds |
|
| 104 | + (int) floor($value / 3600), // Hours |
|
| 105 | + (int) fmod(($value / 60), 60), // Minutes |
|
| 106 | + (int) fmod($value, 60) // Seconds |
|
| 107 | 107 | ) |
| 108 | 108 | ); |
| 109 | 109 | } |
@@ -57,11 +57,11 @@ discard block |
||
| 57 | 57 | public function apply(array $result, Server $server) |
| 58 | 58 | { |
| 59 | 59 | // Determine if there is data to be processed |
| 60 | - if (! empty($result)) { |
|
| 60 | + if (!empty($result)) { |
|
| 61 | 61 | // Handle unit test data generation |
| 62 | 62 | if ($this->writeTestData) { |
| 63 | 63 | // Initialize potential data for unit testing |
| 64 | - $unitTestData = [ ]; |
|
| 64 | + $unitTestData = []; |
|
| 65 | 65 | |
| 66 | 66 | // Add the initial result to the unit test data |
| 67 | 67 | $unitTestData['raw'][$server->id()] = $result; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | // Process each mapping individually |
| 127 | 127 | foreach ($this->normalize[$section] as $target => $source) { |
| 128 | 128 | // Treat explicit source like implicit sources |
| 129 | - if (! is_array($source)) { |
|
| 129 | + if (!is_array($source)) { |
|
| 130 | 130 | $source = [$source]; |
| 131 | 131 | } |
| 132 | 132 | |
@@ -135,14 +135,14 @@ discard block |
||
| 135 | 135 | // Determine if the current source does exist |
| 136 | 136 | if (array_key_exists($s, $data)) { |
| 137 | 137 | // Add the normalized mapping |
| 138 | - $normalized['gq_'.$target] = $data[$s]; |
|
| 138 | + $normalized['gq_' . $target] = $data[$s]; |
|
| 139 | 139 | break; |
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | // Write null in case no source was found |
| 144 | 144 | // TODO: Remove this in the next major version. |
| 145 | - $normalized['gq_'.$target] = isset($normalized['gq_'.$target]) ? $normalized['gq_'.$target] : null; |
|
| 145 | + $normalized['gq_' . $target] = isset($normalized['gq_' . $target]) ? $normalized['gq_' . $target] : null; |
|
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | public function apply(array $result, Server $server) |
| 53 | 53 | { |
| 54 | 54 | // Prevent working on empty results |
| 55 | - if (! empty($result)) { |
|
| 55 | + if (!empty($result)) { |
|
| 56 | 56 | // Handle unit test data generation |
| 57 | 57 | if ($this->writeTestData) { |
| 58 | 58 | // Initialize potential data for unit testing |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | if (is_string($value)) { |
| 71 | 71 | // Strip the colors and update the value by reference |
| 72 | 72 | $value = $executor($value); |
| 73 | - } elseif (! is_array($value)) { |
|
| 73 | + } elseif (!is_array($value)) { |
|
| 74 | 74 | $value = (string) $value; // TODO: Remove this in the next major version. |
| 75 | 75 | } |
| 76 | 76 | }); |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | unset($path[$i]); |
| 114 | 114 | |
| 115 | 115 | // Create missing key |
| 116 | - if (! isset($current[$element])) { |
|
| 116 | + if (!isset($current[$element])) { |
|
| 117 | 117 | $current[$element] = []; |
| 118 | 118 | } |
| 119 | 119 | |