Test Failed
Pull Request — master (#8)
by Moln
05:13
created
src/MySQLReplication/MySQLReplicationFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@
 block discarded – undo
152 152
     {
153 153
         $retryNum = $this->config->getRetry();
154 154
         while (1) {
155
-            if (! $this->socket->isConnected()) {
155
+            if (!$this->socket->isConnected()) {
156 156
                 try {
157 157
                     if ($retryNum) {
158 158
                         $retryNum--;
Please login to merge, or discard this patch.
src/MySQLReplication/Config/Config.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,22 +71,22 @@  discard block
 block discarded – undo
71 71
      */
72 72
     public function validate(): void
73 73
     {
74
-        if (! empty($this->host)) {
74
+        if (!empty($this->host)) {
75 75
             $ip = gethostbyname($this->host);
76 76
             if (false === filter_var($ip, FILTER_VALIDATE_IP)) {
77 77
                 throw new ConfigException(ConfigException::IP_ERROR_MESSAGE, ConfigException::IP_ERROR_CODE);
78 78
             }
79 79
         }
80
-        if (! empty($this->port) && false === filter_var(
80
+        if (!empty($this->port) && false === filter_var(
81 81
             $this->port,
82 82
             FILTER_VALIDATE_INT,
83 83
             ['options' => ['min_range' => 0]]
84 84
         )) {
85 85
             throw new ConfigException(ConfigException::PORT_ERROR_MESSAGE, ConfigException::PORT_ERROR_CODE);
86 86
         }
87
-        if (! empty($this->gtid)) {
87
+        if (!empty($this->gtid)) {
88 88
             foreach (explode(',', $this->gtid) as $gtid) {
89
-                if (! (bool)preg_match(
89
+                if (!(bool)preg_match(
90 90
                     '/^([0-9a-fA-F]{8}(?:-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12})((?::[0-9-]+)+)$/',
91 91
                     $gtid,
92 92
                     $matches
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 }
96 96
             }
97 97
         }
98
-        if (! empty($this->slaveId) && false === filter_var(
98
+        if (!empty($this->slaveId) && false === filter_var(
99 99
             $this->slaveId,
100 100
             FILTER_VALIDATE_INT,
101 101
             ['options' => ['min_range' => 0]]
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
     public function checkDataBasesOnly(string $database): bool
188 188
     {
189
-        return [] !== $this->getDatabasesOnly() && ! self::matchNames($database, $this->getDatabasesOnly());
189
+        return [] !== $this->getDatabasesOnly() && !self::matchNames($database, $this->getDatabasesOnly());
190 190
     }
191 191
 
192 192
     public function getDatabasesOnly(): array
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
     public function checkTablesOnly(string $table): bool
198 198
     {
199
-        return [] !== $this->getTablesOnly() && ! self::matchNames($table, $this->getTablesOnly());
199
+        return [] !== $this->getTablesOnly() && !self::matchNames($table, $this->getTablesOnly());
200 200
     }
201 201
 
202 202
     private static function matchNames(string $subject, array $names): bool
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
     public function checkEvent(int $type): bool
219 219
     {
220
-        if ([] !== $this->getEventsOnly() && ! in_array($type, $this->getEventsOnly(), true)) {
220
+        if ([] !== $this->getEventsOnly() && !in_array($type, $this->getEventsOnly(), true)) {
221 221
             return false;
222 222
         }
223 223
 
Please login to merge, or discard this patch.
src/MySQLReplication/BinLog/BinLogSocketConnect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     private function isWriteSuccessful(string $data): void
114 114
     {
115 115
         $head = ord($data[0]);
116
-        if (! in_array($head, $this->packageOkHeader, true)) {
116
+        if (!in_array($head, $this->packageOkHeader, true)) {
117 117
             $errorCode = unpack('v', $data[1] . $data[2])[1];
118 118
             $errorMessage = '';
119 119
             $packetLength = strlen($data);
Please login to merge, or discard this patch.
src/MySQLReplication/BinaryDataReader/BinaryDataReader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -289,7 +289,7 @@
 block discarded – undo
289 289
 
290 290
     public function isComplete(int $size): bool
291 291
     {
292
-        return ! ($this->readBytes - 20 < $size);
292
+        return !($this->readBytes - 20 < $size);
293 293
     }
294 294
 
295 295
     public function getBinaryDataLength(): int
Please login to merge, or discard this patch.
src/MySQLReplication/Socket/Socket.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     public function connectToStream(string $host, int $port): void
30 30
     {
31 31
         $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
32
-        if (! $this->socket) {
32
+        if (!$this->socket) {
33 33
             throw new SocketException(
34 34
                 SocketException::SOCKET_UNABLE_TO_CREATE_MESSAGE . $this->getSocketErrorMessage(),
35 35
                 SocketException::SOCKET_UNABLE_TO_CREATE_CODE
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         socket_set_block($this->socket);
39 39
         socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1);
40 40
 
41
-        if (! socket_connect($this->socket, $host, $port)) {
41
+        if (!socket_connect($this->socket, $host, $port)) {
42 42
             throw new SocketException($this->getSocketErrorMessage(), $this->getSocketErrorCode());
43 43
         }
44 44
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
     public function writeToSocket(string $data): void
75 75
     {
76
-        if (! socket_write($this->socket, $data, strlen($data))) {
76
+        if (!socket_write($this->socket, $data, strlen($data))) {
77 77
             throw new SocketException(
78 78
                 SocketException::SOCKET_UNABLE_TO_WRITE_MESSAGE . $this->getSocketErrorMessage(),
79 79
                 SocketException::SOCKET_UNABLE_TO_WRITE_CODE
Please login to merge, or discard this patch.
src/MySQLReplication/Event/RowEvent/RowEvent.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
         $fieldDTOCollection = $this->repository->getFields($data['schema_name'], $data['table_name']);
352 352
         $columnDTOCollection = new ColumnDTOCollection();
353 353
         // if you drop tables and parse of logs you will get empty scheme
354
-        if (! $fieldDTOCollection->isEmpty()) {
354
+        if (!$fieldDTOCollection->isEmpty()) {
355 355
             $columnLength = strlen($data['column_types']);
356 356
             for ($offset = 0; $offset < $columnLength; ++$offset) {
357 357
                 // this a dirty hack to prevent row events containing columns which have been dropped
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
      */
392 392
     public function makeWriteRowsDTO(): ?WriteRowsDTO
393 393
     {
394
-        if (! $this->rowInit()) {
394
+        if (!$this->rowInit()) {
395 395
             return null;
396 396
         }
397 397
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
         );
456 456
 
457 457
         $values = [];
458
-        while (! $this->binaryDataReader->isComplete($this->eventInfo->getSizeNoHeader())) {
458
+        while (!$this->binaryDataReader->isComplete($this->eventInfo->getSizeNoHeader())) {
459 459
             $values[] = $this->getColumnData($binaryData);
460 460
         }
461 461
 
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
      */
895 895
     public function makeDeleteRowsDTO(): ?DeleteRowsDTO
896 896
     {
897
-        if (! $this->rowInit()) {
897
+        if (!$this->rowInit()) {
898 898
             return null;
899 899
         }
900 900
 
@@ -916,7 +916,7 @@  discard block
 block discarded – undo
916 916
      */
917 917
     public function makeUpdateRowsDTO(): ?UpdateRowsDTO
918 918
     {
919
-        if (! $this->rowInit()) {
919
+        if (!$this->rowInit()) {
920 920
             return null;
921 921
         }
922 922
 
@@ -925,7 +925,7 @@  discard block
 block discarded – undo
925 925
         $afterBinaryData = $this->binaryDataReader->read($columnsBinarySize);
926 926
 
927 927
         $values = [];
928
-        while (! $this->binaryDataReader->isComplete($this->eventInfo->getSizeNoHeader())) {
928
+        while (!$this->binaryDataReader->isComplete($this->eventInfo->getSizeNoHeader())) {
929 929
             $values[] = [
930 930
                 'before' => $this->getColumnData($beforeBinaryData),
931 931
                 'after' => $this->getColumnData($afterBinaryData)
Please login to merge, or discard this patch.
src/MySQLReplication/Event/RowEvent/ColumnDTO.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@
 block discarded – undo
186 186
 
187 187
     public function isUnsigned(): bool
188 188
     {
189
-        return ! (stripos($this->fieldDTO->getColumnType(), 'unsigned') === false);
189
+        return !(stripos($this->fieldDTO->getColumnType(), 'unsigned') === false);
190 190
     }
191 191
 
192 192
     public function isPrimary(): bool
Please login to merge, or discard this patch.
src/MySQLReplication/Event/Event.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         }
94 94
 
95 95
         // check for ignore and permitted events
96
-        if (! $this->config->checkEvent($eventInfo->getType())) {
96
+        if (!$this->config->checkEvent($eventInfo->getType())) {
97 97
             return;
98 98
         }
99 99
 
Please login to merge, or discard this patch.