Completed
Pull Request — master (#18)
by kacper
02:14
created
src/MySQLReplication/Event/Event.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
         );
87 87
 
88 88
         if (ConstEventType::TABLE_MAP_EVENT === $eventInfo->getType()) {
89
-			$event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeTableMapDTO();
90
-			if ($event !== null) {
91
-				$this->eventDispatcher->dispatch(ConstEventsNames::TABLE_MAP, $event);
92
-			}
89
+            $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeTableMapDTO();
90
+            if ($event !== null) {
91
+                $this->eventDispatcher->dispatch(ConstEventsNames::TABLE_MAP, $event);
92
+            }
93 93
         } else {
94 94
             if ([] !== $this->config->getEventsOnly() && !in_array($eventInfo->getType(), $this->config->getEventsOnly(), true)) {
95 95
                 return;
@@ -100,20 +100,20 @@  discard block
 block discarded – undo
100 100
             }
101 101
 
102 102
             if (in_array($eventInfo->getType(), [ConstEventType::UPDATE_ROWS_EVENT_V1, ConstEventType::UPDATE_ROWS_EVENT_V2], true)) {
103
-				$event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeUpdateRowsDTO();
104
-				if ($event !== null) {
105
-					$this->eventDispatcher->dispatch(ConstEventsNames::UPDATE, $event);
106
-				}
103
+                $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeUpdateRowsDTO();
104
+                if ($event !== null) {
105
+                    $this->eventDispatcher->dispatch(ConstEventsNames::UPDATE, $event);
106
+                }
107 107
             } elseif (in_array($eventInfo->getType(), [ConstEventType::WRITE_ROWS_EVENT_V1, ConstEventType::WRITE_ROWS_EVENT_V2], true)) {
108
-				$event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeWriteRowsDTO();
109
-				if ($event !== null) {
110
-					$this->eventDispatcher->dispatch(ConstEventsNames::WRITE, $event);
111
-				}
108
+                $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeWriteRowsDTO();
109
+                if ($event !== null) {
110
+                    $this->eventDispatcher->dispatch(ConstEventsNames::WRITE, $event);
111
+                }
112 112
             } elseif (in_array($eventInfo->getType(), [ConstEventType::DELETE_ROWS_EVENT_V1, ConstEventType::DELETE_ROWS_EVENT_V2], true)) {
113
-            	$event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeDeleteRowsDTO();
114
-            	if ($event !== null) {
115
-					$this->eventDispatcher->dispatch(ConstEventsNames::DELETE, $event);
116
-				}
113
+                $event = $this->rowEventService->makeRowEvent($binaryDataReader, $eventInfo)->makeDeleteRowsDTO();
114
+                if ($event !== null) {
115
+                    $this->eventDispatcher->dispatch(ConstEventsNames::DELETE, $event);
116
+                }
117 117
             } elseif (ConstEventType::XID_EVENT === $eventInfo->getType()) {
118 118
                 $this->eventDispatcher->dispatch(ConstEventsNames::XID, (new XidEvent($eventInfo, $binaryDataReader))->makeXidDTO());
119 119
             } elseif (ConstEventType::ROTATE_EVENT === $eventInfo->getType()) {
Please login to merge, or discard this patch.
src/MySQLReplication/Event/RowEvent/RowEvent.php 2 patches
Unused Use Statements   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -2,22 +2,22 @@
 block discarded – undo
2 2
 
3 3
 namespace MySQLReplication\Event\RowEvent;
4 4
 
5
-use MySQLReplication\BinaryDataReader\BinaryDataReader;
6
-use MySQLReplication\BinaryDataReader\Exception\BinaryDataReaderException;
7
-use MySQLReplication\Config\Config;
8
-use MySQLReplication\Config\Exception\ConfigException;
9
-use MySQLReplication\Definitions\ConstEventType;
10
-use MySQLReplication\Definitions\ConstFieldType;
11
-use MySQLReplication\Event\DTO\DeleteRowsDTO;
12
-use MySQLReplication\Event\DTO\TableMapDTO;
13
-use MySQLReplication\Event\DTO\UpdateRowsDTO;
14
-use MySQLReplication\Event\DTO\WriteRowsDTO;
15
-use MySQLReplication\Event\EventCommon;
16
-use MySQLReplication\Event\EventInfo;
17
-use MySQLReplication\Event\Exception\EventException;
18
-use MySQLReplication\Exception\MySQLReplicationException;
19
-use MySQLReplication\JsonBinaryDecoder\JsonBinaryDecoderException;
20
-use MySQLReplication\JsonBinaryDecoder\JsonBinaryDecoderFactory;
5
+use MySQLReplication\BinaryDataReader\BinaryDataReader;
6
+use MySQLReplication\BinaryDataReader\Exception\BinaryDataReaderException;
7
+use MySQLReplication\Config\Config;
8
+use MySQLReplication\Config\Exception\ConfigException;
9
+use MySQLReplication\Definitions\ConstEventType;
10
+use MySQLReplication\Definitions\ConstFieldType;
11
+use MySQLReplication\Event\DTO\DeleteRowsDTO;
12
+use MySQLReplication\Event\DTO\TableMapDTO;
13
+use MySQLReplication\Event\DTO\UpdateRowsDTO;
14
+use MySQLReplication\Event\DTO\WriteRowsDTO;
15
+use MySQLReplication\Event\EventCommon;
16
+use MySQLReplication\Event\EventInfo;
17
+use MySQLReplication\Event\Exception\EventException;
18
+use MySQLReplication\Exception\MySQLReplicationException;
19
+use MySQLReplication\JsonBinaryDecoder\JsonBinaryDecoderException;
20
+use MySQLReplication\JsonBinaryDecoder\JsonBinaryDecoderFactory;
21 21
 use MySQLReplication\Repository\MySQLRepository;
22 22
 
23 23
 /**
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -401,9 +401,9 @@
 block discarded – undo
401 401
                 $values[$name] = $this->getDatetime2($column);
402 402
             }
403 403
             elseif ($column['type'] === ConstFieldType::TIMESTAMP)
404
-			{
405
-				$values[$name] = date('c', $this->binaryDataReader->readUInt32());
406
-			}
404
+            {
405
+                $values[$name] = date('c', $this->binaryDataReader->readUInt32());
406
+            }
407 407
             elseif ($column['type'] === ConstFieldType::TIME2)
408 408
             {
409 409
                 $values[$name] = $this->getTime2($column);
Please login to merge, or discard this patch.