Completed
Push — master ( 20620d...fb2510 )
by kacper
06:37
created
src/MySQLReplication/BinLog/BinLogServerInfo.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
             {
36 36
                 $i++;
37 37
                 break;
38
-            }
39
-            else
38
+            } else
40 39
             {
41 40
                 self::$serverInfo['server_version'] .= $pack[$i];
42 41
             }
@@ -116,8 +115,7 @@  discard block
 block discarded – undo
116 115
             if (false !== strpos($version, self::MYSQL_VERSION_MARIADB))
117 116
             {
118 117
                 self::$serverInfo['version_name'] = self::MYSQL_VERSION_MARIADB;
119
-            }
120
-            else if (false !== strpos($version, self::MYSQL_VERSION_PERCONA))
118
+            } else if (false !== strpos($version, self::MYSQL_VERSION_PERCONA))
121 119
             {
122 120
                 self::$serverInfo['version_name'] = self::MYSQL_VERSION_PERCONA;
123 121
             }
Please login to merge, or discard this patch.
src/MySQLReplication/Gtid/Gtid.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
             {
54 54
                 $buffer .= BinaryDataReader::pack64bit($interval[0]);
55 55
                 $buffer .= BinaryDataReader::pack64bit($interval[1]);
56
-            }
57
-            else
56
+            } else
58 57
             {
59 58
                 $buffer .= BinaryDataReader::pack64bit($interval[0]);
60 59
                 $buffer .= BinaryDataReader::pack64bit($interval[0] + 1);
Please login to merge, or discard this patch.
src/MySQLReplication/BinaryDataReader/BinaryDataReader.php 1 patch
Braces   +14 added lines, -28 removed lines patch added patch discarded remove patch
@@ -109,17 +109,14 @@  discard block
 block discarded – undo
109 109
         if ($c < self::UNSIGNED_CHAR_COLUMN)
110 110
         {
111 111
             return $c;
112
-        }
113
-        elseif ($c == self::UNSIGNED_SHORT_COLUMN)
112
+        } elseif ($c == self::UNSIGNED_SHORT_COLUMN)
114 113
         {
115 114
             return $this->readUInt16();
116 115
 
117
-        }
118
-        elseif ($c == self::UNSIGNED_INT24_COLUMN)
116
+        } elseif ($c == self::UNSIGNED_INT24_COLUMN)
119 117
         {
120 118
             return $this->readUInt24();
121
-        }
122
-        elseif ($c == self::UNSIGNED_INT64_COLUMN)
119
+        } elseif ($c == self::UNSIGNED_INT64_COLUMN)
123 120
         {
124 121
             return $this->readUInt64();
125 122
         }
@@ -208,32 +205,25 @@  discard block
 block discarded – undo
208 205
         if ($size == self::UNSIGNED_CHAR_LENGTH)
209 206
         {
210 207
             return $this->readUInt8();
211
-        }
212
-        elseif ($size == self::UNSIGNED_SHORT_LENGTH)
208
+        } elseif ($size == self::UNSIGNED_SHORT_LENGTH)
213 209
         {
214 210
             return $this->readUInt16();
215
-        }
216
-        elseif ($size == self::UNSIGNED_INT24_LENGTH)
211
+        } elseif ($size == self::UNSIGNED_INT24_LENGTH)
217 212
         {
218 213
             return $this->readUInt24();
219
-        }
220
-        elseif ($size == self::UNSIGNED_INT32_LENGTH)
214
+        } elseif ($size == self::UNSIGNED_INT32_LENGTH)
221 215
         {
222 216
             return $this->readUInt32();
223
-        }
224
-        elseif ($size == self::UNSIGNED_INT40_LENGTH)
217
+        } elseif ($size == self::UNSIGNED_INT40_LENGTH)
225 218
         {
226 219
             return $this->readUInt40();
227
-        }
228
-        elseif ($size == self::UNSIGNED_INT48_LENGTH)
220
+        } elseif ($size == self::UNSIGNED_INT48_LENGTH)
229 221
         {
230 222
             return $this->readUInt48();
231
-        }
232
-        elseif ($size == self::UNSIGNED_INT56_LENGTH)
223
+        } elseif ($size == self::UNSIGNED_INT56_LENGTH)
233 224
         {
234 225
             return $this->readUInt56();
235
-        }
236
-        elseif ($size == self::UNSIGNED_INT64_LENGTH)
226
+        } elseif ($size == self::UNSIGNED_INT64_LENGTH)
237 227
         {
238 228
             return $this->readUInt64();
239 229
         }
@@ -302,20 +292,16 @@  discard block
 block discarded – undo
302 292
         if ($size == self::UNSIGNED_CHAR_LENGTH)
303 293
         {
304 294
             return $this->readInt8();
305
-        }
306
-        elseif ($size == self::UNSIGNED_SHORT_LENGTH)
295
+        } elseif ($size == self::UNSIGNED_SHORT_LENGTH)
307 296
         {
308 297
             return $this->readInt16Be();
309
-        }
310
-        elseif ($size == self::UNSIGNED_INT24_LENGTH)
298
+        } elseif ($size == self::UNSIGNED_INT24_LENGTH)
311 299
         {
312 300
             return $this->readInt24Be();
313
-        }
314
-        elseif ($size == self::UNSIGNED_INT32_LENGTH)
301
+        } elseif ($size == self::UNSIGNED_INT32_LENGTH)
315 302
         {
316 303
             return $this->readInt32Be();
317
-        }
318
-        elseif ($size == self::UNSIGNED_INT40_LENGTH)
304
+        } elseif ($size == self::UNSIGNED_INT40_LENGTH)
319 305
         {
320 306
             return $this->readInt40Be();
321 307
         }
Please login to merge, or discard this patch.
src/MySQLReplication/JsonBinaryDecoder/JsonBinaryDecoderService.php 1 patch
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -94,20 +94,16 @@  discard block
 block discarded – undo
94 94
         if (self::SMALL_OBJECT === $type)
95 95
         {
96 96
             $this->parseObject(BinaryDataReader::UNSIGNED_SHORT_LENGTH);
97
-        }
98
-        else if (self::LARGE_OBJECT === $type)
97
+        } else if (self::LARGE_OBJECT === $type)
99 98
         {
100 99
             $this->parseObject(BinaryDataReader::UNSIGNED_INT32_LENGTH);
101
-        }
102
-        else if (self::SMALL_ARRAY === $type)
100
+        } else if (self::SMALL_ARRAY === $type)
103 101
         {
104 102
             $this->parseArray(BinaryDataReader::UNSIGNED_SHORT_LENGTH);
105
-        }
106
-        else if (self::LARGE_ARRAY === $type)
103
+        } else if (self::LARGE_ARRAY === $type)
107 104
         {
108 105
             $this->parseObject(BinaryDataReader::UNSIGNED_INT32_LENGTH);
109
-        }
110
-        else
106
+        } else
111 107
         {
112 108
             $this->parseScalar($type);
113 109
         }
@@ -175,24 +171,21 @@  discard block
 block discarded – undo
175 171
                 $this->readLiteral(),
176 172
                 $type
177 173
             );
178
-        }
179
-        else if (self::INT16 === $type)
174
+        } else if (self::INT16 === $type)
180 175
         {
181 176
             return new JsonBinaryDecoderValue(
182 177
                 true,
183 178
                 $this->binaryDataReader->readInt16(),
184 179
                 $type
185 180
             );
186
-        }
187
-        else if (self::UINT16 === $type)
181
+        } else if (self::UINT16 === $type)
188 182
         {
189 183
             return new JsonBinaryDecoderValue(
190 184
                 true,
191 185
                 $this->binaryDataReader->readUInt16(),
192 186
                 $type
193 187
             );
194
-        }
195
-        else if (BinaryDataReader::UNSIGNED_INT32_LENGTH === $intSize)
188
+        } else if (BinaryDataReader::UNSIGNED_INT32_LENGTH === $intSize)
196 189
         {
197 190
             if (self::INT32 === $type)
198 191
             {
@@ -201,8 +194,7 @@  discard block
 block discarded – undo
201 194
                     $this->binaryDataReader->readInt32(),
202 195
                     $type
203 196
                 );
204
-            }
205
-            else if (self::UINT32 === $type)
197
+            } else if (self::UINT32 === $type)
206 198
             {
207 199
                 return new JsonBinaryDecoderValue(
208 200
                     true,
@@ -210,8 +202,7 @@  discard block
 block discarded – undo
210 202
                     $type
211 203
                 );
212 204
             }
213
-        }
214
-        else
205
+        } else
215 206
         {
216 207
             $offset = $this->binaryDataReader->readUIntBySize($intSize);
217 208
             if ($offset > $numBytes)
@@ -242,12 +233,10 @@  discard block
 block discarded – undo
242 233
         if (0 === $literal)
243 234
         {
244 235
             return null;
245
-        }
246
-        else if (1 === $literal)
236
+        } else if (1 === $literal)
247 237
         {
248 238
             return true;
249
-        }
250
-        else if (2 === $literal)
239
+        } else if (2 === $literal)
251 240
         {
252 241
             return false;
253 242
         }
@@ -263,18 +252,15 @@  discard block
 block discarded – undo
263 252
         if (false === $jsonBinaryDecoderValue->isIsResolved())
264 253
         {
265 254
             $this->parseJson($jsonBinaryDecoderValue->getType());
266
-        }
267
-        else
255
+        } else
268 256
         {
269 257
             if (null === $jsonBinaryDecoderValue->getValue())
270 258
             {
271 259
                 $this->jsonBinaryDecoderFormatter->formatValueNull();
272
-            }
273
-            elseif (is_bool($jsonBinaryDecoderValue->getValue()))
260
+            } elseif (is_bool($jsonBinaryDecoderValue->getValue()))
274 261
             {
275 262
                 $this->jsonBinaryDecoderFormatter->formatValueBool($jsonBinaryDecoderValue->getValue());
276
-            }
277
-            elseif (is_numeric($jsonBinaryDecoderValue->getValue()))
263
+            } elseif (is_numeric($jsonBinaryDecoderValue->getValue()))
278 264
             {
279 265
                 $this->jsonBinaryDecoderFormatter->formatValueNumeric($jsonBinaryDecoderValue->getValue());
280 266
             }
@@ -314,8 +300,7 @@  discard block
 block discarded – undo
314 300
         if (null === $r)
315 301
         {
316 302
             $this->jsonBinaryDecoderFormatter->formatValueNull();
317
-        }
318
-        else
303
+        } else
319 304
         {
320 305
             $this->jsonBinaryDecoderFormatter->formatValueBool($r);
321 306
         }
@@ -326,32 +311,25 @@  discard block
 block discarded – undo
326 311
         if (self::LITERAL === $type)
327 312
         {
328 313
             $this->parseBoolean();
329
-        }
330
-        else if (self::INT16 === $type)
314
+        } else if (self::INT16 === $type)
331 315
         {
332 316
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readInt16());
333
-        }
334
-        else if (self::INT32 === $type)
317
+        } else if (self::INT32 === $type)
335 318
         {
336 319
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readInt32());
337
-        }
338
-        else if (self::INT64 === $type)
320
+        } else if (self::INT64 === $type)
339 321
         {
340 322
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readInt64());
341
-        }
342
-        else if (self::UINT16 === $type)
323
+        } else if (self::UINT16 === $type)
343 324
         {
344 325
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readUInt16());
345
-        }
346
-        else if (self::UINT64 === $type)
326
+        } else if (self::UINT64 === $type)
347 327
         {
348 328
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readUInt64());
349
-        }
350
-        else if (self::DOUBLE === $type)
329
+        } else if (self::DOUBLE === $type)
351 330
         {
352 331
             $this->jsonBinaryDecoderFormatter->formatValue($this->binaryDataReader->readDouble());
353
-        }
354
-        else if (self::STRING === $type)
332
+        } else if (self::STRING === $type)
355 333
         {
356 334
             $this->jsonBinaryDecoderFormatter->formatValue(
357 335
                 $this->binaryDataReader->read($this->readVariableInt())
Please login to merge, or discard this patch.
src/MySQLReplication/BinLog/BinLogSocketConnect.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -171,8 +171,7 @@  discard block
 block discarded – undo
171 171
         if (in_array($head, $this->packageOkHeader, true))
172 172
         {
173 173
             return ['status' => true, 'code' => 0, 'msg' => ''];
174
-        }
175
-        else
174
+        } else
176 175
         {
177 176
             $error_code = unpack('v', $packet[1] . $packet[2])[1];
178 177
             $error_msg = '';
@@ -230,8 +229,7 @@  discard block
 block discarded – undo
230 229
         if ('' !== $this->config->getGtid())
231 230
         {
232 231
             $this->setBinLogDumpGtid();
233
-        }
234
-        else
232
+        } else
235 233
         {
236 234
             $this->setBinLogDump();
237 235
         }
Please login to merge, or discard this patch.
src/MySQLReplication/Event/Event.php 1 patch
Braces   +8 added lines, -16 removed lines patch added patch discarded remove patch
@@ -100,8 +100,7 @@  discard block
 block discarded – undo
100 100
             {
101 101
                 $this->eventDispatcher->dispatch(ConstEventsNames::TABLE_MAP, $event);
102 102
             }
103
-        }
104
-        else
103
+        } else
105 104
         {
106 105
             if ([] !== $this->config->getEventsOnly() && !in_array($eventInfo->getType(), $this->config->getEventsOnly(), true))
107 106
             {
@@ -120,40 +119,33 @@  discard block
 block discarded – undo
120 119
                 {
121 120
                     $this->eventDispatcher->dispatch(ConstEventsNames::UPDATE, $event);
122 121
                 }
123
-            }
124
-            elseif (in_array($eventInfo->getType(), [ConstEventType::WRITE_ROWS_EVENT_V1, ConstEventType::WRITE_ROWS_EVENT_V2], true))
122
+            } elseif (in_array($eventInfo->getType(), [ConstEventType::WRITE_ROWS_EVENT_V1, ConstEventType::WRITE_ROWS_EVENT_V2], true))
125 123
             {
126 124
                 $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeWriteRowsDTO();
127 125
                 if ($event !== null)
128 126
                 {
129 127
                     $this->eventDispatcher->dispatch(ConstEventsNames::WRITE, $event);
130 128
                 }
131
-            }
132
-            elseif (in_array($eventInfo->getType(), [ConstEventType::DELETE_ROWS_EVENT_V1, ConstEventType::DELETE_ROWS_EVENT_V2], true))
129
+            } elseif (in_array($eventInfo->getType(), [ConstEventType::DELETE_ROWS_EVENT_V1, ConstEventType::DELETE_ROWS_EVENT_V2], true))
133 130
             {
134 131
                 $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeDeleteRowsDTO();
135 132
                 if ($event !== null)
136 133
                 {
137 134
                     $this->eventDispatcher->dispatch(ConstEventsNames::DELETE, $event);
138 135
                 }
139
-            }
140
-            elseif (ConstEventType::XID_EVENT === $eventInfo->getType())
136
+            } elseif (ConstEventType::XID_EVENT === $eventInfo->getType())
141 137
             {
142 138
                 $this->eventDispatcher->dispatch(ConstEventsNames::XID, (new XidEvent($eventInfo, $binaryDataReader))->makeXidDTO());
143
-            }
144
-            elseif (ConstEventType::ROTATE_EVENT === $eventInfo->getType())
139
+            } elseif (ConstEventType::ROTATE_EVENT === $eventInfo->getType())
145 140
             {
146 141
                 $this->eventDispatcher->dispatch(ConstEventsNames::ROTATE, (new RotateEvent($eventInfo, $binaryDataReader))->makeRotateEventDTO());
147
-            }
148
-            elseif (ConstEventType::GTID_LOG_EVENT === $eventInfo->getType())
142
+            } elseif (ConstEventType::GTID_LOG_EVENT === $eventInfo->getType())
149 143
             {
150 144
                 $this->eventDispatcher->dispatch(ConstEventsNames::GTID, (new GtidEvent($eventInfo, $binaryDataReader))->makeGTIDLogDTO());
151
-            }
152
-            elseif (ConstEventType::QUERY_EVENT === $eventInfo->getType())
145
+            } elseif (ConstEventType::QUERY_EVENT === $eventInfo->getType())
153 146
             {
154 147
                 $this->eventDispatcher->dispatch(ConstEventsNames::QUERY, (new QueryEvent($eventInfo, $binaryDataReader))->makeQueryDTO());
155
-            }
156
-            elseif (ConstEventType::MARIA_GTID_EVENT === $eventInfo->getType())
148
+            } elseif (ConstEventType::MARIA_GTID_EVENT === $eventInfo->getType())
157 149
             {
158 150
                 $this->eventDispatcher->dispatch(ConstEventsNames::MARIADB_GTID, (new MariaDbGtidEvent($eventInfo, $binaryDataReader))->makeMariaDbGTIDLogDTO());
159 151
             }
Please login to merge, or discard this patch.
src/MySQLReplication/Event/RowEvent/Columns.php 1 patch
Braces   +15 added lines, -30 removed lines patch added patch discarded remove patch
@@ -46,53 +46,41 @@  discard block
 block discarded – undo
46 46
         if (self::$field['type'] === ConstFieldType::VARCHAR)
47 47
         {
48 48
             self::$field['max_length'] = $binaryDataReader->readInt16();
49
-        }
50
-        elseif (self::$field['type'] === ConstFieldType::DOUBLE)
49
+        } elseif (self::$field['type'] === ConstFieldType::DOUBLE)
51 50
         {
52 51
             self::$field['size'] = $binaryDataReader->readUInt8();
53
-        }
54
-        elseif (self::$field['type'] === ConstFieldType::FLOAT)
52
+        } elseif (self::$field['type'] === ConstFieldType::FLOAT)
55 53
         {
56 54
             self::$field['size'] = $binaryDataReader->readUInt8();
57
-        }
58
-        elseif (self::$field['type'] === ConstFieldType::TIMESTAMP2)
55
+        } elseif (self::$field['type'] === ConstFieldType::TIMESTAMP2)
59 56
         {
60 57
             self::$field['fsp'] = $binaryDataReader->readUInt8();
61
-        }
62
-        elseif (self::$field['type'] === ConstFieldType::DATETIME2)
58
+        } elseif (self::$field['type'] === ConstFieldType::DATETIME2)
63 59
         {
64 60
             self::$field['fsp'] = $binaryDataReader->readUInt8();
65
-        }
66
-        elseif (self::$field['type'] === ConstFieldType::TIME2)
61
+        } elseif (self::$field['type'] === ConstFieldType::TIME2)
67 62
         {
68 63
             self::$field['fsp'] = $binaryDataReader->readUInt8();
69
-        }
70
-        elseif (self::$field['type'] === ConstFieldType::TINY && $columnSchema['COLUMN_TYPE'] === 'tinyint(1)')
64
+        } elseif (self::$field['type'] === ConstFieldType::TINY && $columnSchema['COLUMN_TYPE'] === 'tinyint(1)')
71 65
         {
72 66
             self::$field['type_is_bool'] = true;
73
-        }
74
-        elseif (self::$field['type'] === ConstFieldType::VAR_STRING || self::$field['type'] === ConstFieldType::STRING)
67
+        } elseif (self::$field['type'] === ConstFieldType::VAR_STRING || self::$field['type'] === ConstFieldType::STRING)
75 68
         {
76 69
             self::getFieldSpecial($binaryDataReader, $columnSchema);
77
-        }
78
-        elseif (self::$field['type'] === ConstFieldType::BLOB)
70
+        } elseif (self::$field['type'] === ConstFieldType::BLOB)
79 71
         {
80 72
             self::$field['length_size'] = $binaryDataReader->readUInt8();
81
-        }
82
-        elseif (self::$field['type'] === ConstFieldType::GEOMETRY)
73
+        } elseif (self::$field['type'] === ConstFieldType::GEOMETRY)
83 74
         {
84 75
             self::$field['length_size'] = $binaryDataReader->readUInt8();
85
-        }
86
-        elseif (self::$field['type'] === ConstFieldType::JSON)
76
+        } elseif (self::$field['type'] === ConstFieldType::JSON)
87 77
         {
88 78
             self::$field['length_size'] = $binaryDataReader->readUInt8();
89
-        }
90
-        elseif (self::$field['type'] === ConstFieldType::NEWDECIMAL)
79
+        } elseif (self::$field['type'] === ConstFieldType::NEWDECIMAL)
91 80
         {
92 81
             self::$field['precision'] = $binaryDataReader->readUInt8();
93 82
             self::$field['decimals'] = $binaryDataReader->readUInt8();
94
-        }
95
-        elseif (self::$field['type'] === ConstFieldType::BIT)
83
+        } elseif (self::$field['type'] === ConstFieldType::BIT)
96 84
         {
97 85
             $bits = $binaryDataReader->readUInt8();
98 86
             $bytes = $binaryDataReader->readUInt8();
@@ -117,8 +105,7 @@  discard block
 block discarded – undo
117 105
             self::$field['type'] = $real_type;
118 106
             self::$field['size'] = $metadata & 0x00ff;
119 107
             self::getFieldSpecialValues($columnSchema);
120
-        }
121
-        else
108
+        } else
122 109
         {
123 110
             self::$field['max_length'] = ((($metadata >> 4) & 0x300) ^ 0x300) + ($metadata & 0x00ff);
124 111
         }
@@ -133,12 +120,10 @@  discard block
 block discarded – undo
133 120
         if (self::$field['type'] === ConstFieldType::ENUM)
134 121
         {
135 122
             self::$field['enum_values'] = explode(',', str_replace(['enum(', ')', '\''], '', $columnSchema['COLUMN_TYPE']));
136
-        }
137
-        else if (self::$field['type'] === ConstFieldType::SET)
123
+        } else if (self::$field['type'] === ConstFieldType::SET)
138 124
         {
139 125
             self::$field['set_values'] = explode(',', str_replace(['set(', ')', '\''], '', $columnSchema['COLUMN_TYPE']));
140
-        }
141
-        else
126
+        } else
142 127
         {
143 128
             throw new ConfigException('Type not handled! - ' . self::$field['type']);
144 129
         }
Please login to merge, or discard this patch.
src/MySQLReplication/Event/RowEvent/RowEvent.php 1 patch
Braces   +37 added lines, -74 removed lines patch added patch discarded remove patch
@@ -165,8 +165,7 @@  discard block
 block discarded – undo
165 165
                     ];
166 166
 
167 167
                     $type = ConstFieldType::IGNORE;
168
-                }
169
-                else
168
+                } else
170 169
                 {
171 170
                     $type = ord($data['column_types'][$i]);
172 171
                 }
@@ -305,123 +304,98 @@  discard block
 block discarded – undo
305 304
             if ($this->checkNull($null_bitmap, $nullBitmapIndex))
306 305
             {
307 306
                 $values[$name] = null;
308
-            }
309
-            elseif ($column['type'] === ConstFieldType::IGNORE)
307
+            } elseif ($column['type'] === ConstFieldType::IGNORE)
310 308
             {
311 309
                 $values[$name] = null;
312
-            }
313
-            elseif ($column['type'] === ConstFieldType::TINY)
310
+            } elseif ($column['type'] === ConstFieldType::TINY)
314 311
             {
315 312
                 if (true === $column['unsigned'])
316 313
                 {
317 314
                     $values[$name] = $this->binaryDataReader->readUInt8();
318
-                }
319
-                else
315
+                } else
320 316
                 {
321 317
                     $values[$name] = $this->binaryDataReader->readInt8();
322 318
                 }
323
-            }
324
-            elseif ($column['type'] === ConstFieldType::SHORT)
319
+            } elseif ($column['type'] === ConstFieldType::SHORT)
325 320
             {
326 321
                 if (true === $column['unsigned'])
327 322
                 {
328 323
                     $values[$name] = $this->binaryDataReader->readUInt16();
329
-                }
330
-                else
324
+                } else
331 325
                 {
332 326
                     $values[$name] = $this->binaryDataReader->readInt16();
333 327
                 }
334
-            }
335
-            elseif ($column['type'] === ConstFieldType::LONG)
328
+            } elseif ($column['type'] === ConstFieldType::LONG)
336 329
             {
337 330
                 if (true === $column['unsigned'])
338 331
                 {
339 332
                     $values[$name] = $this->binaryDataReader->readUInt32();
340
-                }
341
-                else
333
+                } else
342 334
                 {
343 335
                     $values[$name] = $this->binaryDataReader->readInt32();
344 336
                 }
345
-            }
346
-            elseif ($column['type'] === ConstFieldType::LONGLONG)
337
+            } elseif ($column['type'] === ConstFieldType::LONGLONG)
347 338
             {
348 339
                 if (true === $column['unsigned'])
349 340
                 {
350 341
                     $values[$name] = $this->binaryDataReader->readUInt64();
351
-                }
352
-                else
342
+                } else
353 343
                 {
354 344
                     $values[$name] = $this->binaryDataReader->readInt64();
355 345
                 }
356
-            }
357
-            elseif ($column['type'] === ConstFieldType::INT24)
346
+            } elseif ($column['type'] === ConstFieldType::INT24)
358 347
             {
359 348
                 if (true === $column['unsigned'])
360 349
                 {
361 350
                     $values[$name] = $this->binaryDataReader->readUInt24();
362
-                }
363
-                else
351
+                } else
364 352
                 {
365 353
                     $values[$name] = $this->binaryDataReader->readInt24();
366 354
                 }
367
-            }
368
-            elseif ($column['type'] === ConstFieldType::FLOAT)
355
+            } elseif ($column['type'] === ConstFieldType::FLOAT)
369 356
             {
370 357
                 // http://dev.mysql.com/doc/refman/5.7/en/floating-point-types.html FLOAT(7,4)
371 358
                 $values[$name] = round($this->binaryDataReader->readFloat(), 4);
372
-            }
373
-            elseif ($column['type'] === ConstFieldType::DOUBLE)
359
+            } elseif ($column['type'] === ConstFieldType::DOUBLE)
374 360
             {
375 361
                 $values[$name] = $this->binaryDataReader->readDouble();
376
-            }
377
-            elseif ($column['type'] === ConstFieldType::VARCHAR || $column['type'] === ConstFieldType::STRING)
362
+            } elseif ($column['type'] === ConstFieldType::VARCHAR || $column['type'] === ConstFieldType::STRING)
378 363
             {
379 364
                 if ($column['max_length'] > 255)
380 365
                 {
381 366
                     $values[$name] = $this->getString(2, $column);
382
-                }
383
-                else
367
+                } else
384 368
                 {
385 369
                     $values[$name] = $this->getString(1, $column);
386 370
                 }
387
-            }
388
-            elseif ($column['type'] === ConstFieldType::NEWDECIMAL)
371
+            } elseif ($column['type'] === ConstFieldType::NEWDECIMAL)
389 372
             {
390 373
                 $values[$name] = $this->getDecimal($column);
391
-            }
392
-            elseif ($column['type'] === ConstFieldType::BLOB)
374
+            } elseif ($column['type'] === ConstFieldType::BLOB)
393 375
             {
394 376
                 $values[$name] = $this->getString($column['length_size'], $column);
395
-            }
396
-            elseif ($column['type'] === ConstFieldType::DATETIME)
377
+            } elseif ($column['type'] === ConstFieldType::DATETIME)
397 378
             {
398 379
                 $values[$name] = $this->getDatetime();
399
-            }
400
-            elseif ($column['type'] === ConstFieldType::DATETIME2)
380
+            } elseif ($column['type'] === ConstFieldType::DATETIME2)
401 381
             {
402 382
                 $values[$name] = $this->getDatetime2($column);
403
-            }
404
-            elseif ($column['type'] === ConstFieldType::TIMESTAMP)
383
+            } elseif ($column['type'] === ConstFieldType::TIMESTAMP)
405 384
 			{
406 385
 				$values[$name] = date('c', $this->binaryDataReader->readUInt32());
407
-			}
408
-            elseif ($column['type'] === ConstFieldType::TIME2)
386
+			} elseif ($column['type'] === ConstFieldType::TIME2)
409 387
             {
410 388
                 $values[$name] = $this->getTime2($column);
411
-            }
412
-            elseif ($column['type'] === ConstFieldType::TIMESTAMP2)
389
+            } elseif ($column['type'] === ConstFieldType::TIMESTAMP2)
413 390
             {
414 391
                 $values[$name] = $this->getTimestamp2($column);
415
-            }
416
-            elseif ($column['type'] === ConstFieldType::DATE)
392
+            } elseif ($column['type'] === ConstFieldType::DATE)
417 393
             {
418 394
                 $values[$name] = $this->getDate();
419
-            }
420
-            elseif ($column['type'] === ConstFieldType::YEAR)
395
+            } elseif ($column['type'] === ConstFieldType::YEAR)
421 396
             {
422 397
                 $values[$name] = $this->binaryDataReader->readUInt8() + 1900;
423
-            }
424
-            elseif ($column['type'] === ConstFieldType::ENUM)
398
+            } elseif ($column['type'] === ConstFieldType::ENUM)
425 399
             {
426 400
                 $value = $this->binaryDataReader->readUIntBySize($column['size']) - 1;
427 401
 
@@ -431,26 +405,21 @@  discard block
 block discarded – undo
431 405
                 {
432 406
                     $values[$name] = $column['enum_values'][$value];
433 407
                 }
434
-            }
435
-            elseif ($column['type'] === ConstFieldType::SET)
408
+            } elseif ($column['type'] === ConstFieldType::SET)
436 409
             {
437 410
                 $values[$name] = $this->getSet($column);
438
-            }
439
-            elseif ($column['type'] === ConstFieldType::BIT)
411
+            } elseif ($column['type'] === ConstFieldType::BIT)
440 412
             {
441 413
                 $values[$name] = $this->getBit($column);
442
-            }
443
-            elseif ($column['type'] === ConstFieldType::GEOMETRY)
414
+            } elseif ($column['type'] === ConstFieldType::GEOMETRY)
444 415
             {
445 416
                 $values[$name] = $this->binaryDataReader->readLengthCodedPascalString($column['length_size']);
446
-            }
447
-            elseif ($column['type'] === ConstFieldType::JSON)
417
+            } elseif ($column['type'] === ConstFieldType::JSON)
448 418
             {
449 419
                 $values[$name] = $this->jsonBinaryDecoderFactory->makeJsonBinaryDecoder(
450 420
                     $this->binaryDataReader->readLengthCodedPascalString($column['length_size'])
451 421
                 )->parseToString();
452
-            }
453
-            else
422
+            } else
454 423
             {
455 424
                 throw new MySQLReplicationException('Unknown row type: ' . $column['type']);
456 425
             }
@@ -552,8 +521,7 @@  discard block
 block discarded – undo
552 521
         {
553 522
             $mask = 0;
554 523
             $res = '';
555
-        }
556
-        else
524
+        } else
557 525
         {
558 526
             $mask = -1;
559 527
             $res = '-';
@@ -688,12 +656,10 @@  discard block
 block discarded – undo
688 656
         if ($column['fsp'] === 1 || $column['fsp'] === 2)
689 657
         {
690 658
             $read = 1;
691
-        }
692
-        elseif ($column['fsp'] === 3 || $column['fsp'] === 4)
659
+        } elseif ($column['fsp'] === 3 || $column['fsp'] === 4)
693 660
         {
694 661
             $read = 2;
695
-        }
696
-        elseif ($column ['fsp'] === 5 || $column['fsp'] === 6)
662
+        } elseif ($column ['fsp'] === 5 || $column['fsp'] === 6)
697 663
         {
698 664
             $read = 3;
699 665
         }
@@ -814,8 +780,7 @@  discard block
 block discarded – undo
814 780
                 if (1 === $column['bytes'])
815 781
                 {
816 782
                     $end = $column['bits'];
817
-                }
818
-                else
783
+                } else
819 784
                 {
820 785
                     $end = $column['bits'] % 8;
821 786
                     if (0 === $end)
@@ -823,8 +788,7 @@  discard block
 block discarded – undo
823 788
                         $end = 8;
824 789
                     }
825 790
                 }
826
-            }
827
-            else
791
+            } else
828 792
             {
829 793
                 $end = 8;
830 794
             }
@@ -834,8 +798,7 @@  discard block
 block discarded – undo
834 798
                 if ($data & (1 << $bit))
835 799
                 {
836 800
                     $current_byte .= '1';
837
-                }
838
-                else
801
+                } else
839 802
                 {
840 803
                     $current_byte .= '0';
841 804
                 }
Please login to merge, or discard this patch.