@@ -86,7 +86,10 @@ public function consume()
86
86
);
87
87
88
88
if (ConstEventType::TABLE_MAP_EVENT === $ eventInfo ->getType ()) {
89
- $ this ->eventDispatcher ->dispatch (ConstEventsNames::TABLE_MAP , $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeTableMapDTO ());
89
+ $ event = $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeTableMapDTO ();
90
+ if ($ event !== null ) {
91
+ $ this ->eventDispatcher ->dispatch (ConstEventsNames::TABLE_MAP , $ event );
92
+ }
90
93
} else {
91
94
if ([] !== $ this ->config ->getEventsOnly () && !in_array ($ eventInfo ->getType (), $ this ->config ->getEventsOnly (), true )) {
92
95
return ;
@@ -97,11 +100,20 @@ public function consume()
97
100
}
98
101
99
102
if (in_array ($ eventInfo ->getType (), [ConstEventType::UPDATE_ROWS_EVENT_V1 , ConstEventType::UPDATE_ROWS_EVENT_V2 ], true )) {
100
- $ this ->eventDispatcher ->dispatch (ConstEventsNames::UPDATE , $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeUpdateRowsDTO ());
103
+ $ event = $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeUpdateRowsDTO ();
104
+ if ($ event !== null ) {
105
+ $ this ->eventDispatcher ->dispatch (ConstEventsNames::UPDATE , $ event );
106
+ }
101
107
} elseif (in_array ($ eventInfo ->getType (), [ConstEventType::WRITE_ROWS_EVENT_V1 , ConstEventType::WRITE_ROWS_EVENT_V2 ], true )) {
102
- $ this ->eventDispatcher ->dispatch (ConstEventsNames::WRITE , $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeWriteRowsDTO ());
108
+ $ event = $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeWriteRowsDTO ();
109
+ if ($ event !== null ) {
110
+ $ this ->eventDispatcher ->dispatch (ConstEventsNames::WRITE , $ event );
111
+ }
103
112
} elseif (in_array ($ eventInfo ->getType (), [ConstEventType::DELETE_ROWS_EVENT_V1 , ConstEventType::DELETE_ROWS_EVENT_V2 ], true )) {
104
- $ this ->eventDispatcher ->dispatch (ConstEventsNames::DELETE , $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeDeleteRowsDTO ());
113
+ $ event = $ this ->rowEventService ->makeRowEvent ($ binaryDataReader , $ eventInfo )->makeDeleteRowsDTO ();
114
+ if ($ event !== null ) {
115
+ $ this ->eventDispatcher ->dispatch (ConstEventsNames::DELETE , $ event );
116
+ }
105
117
} elseif (ConstEventType::XID_EVENT === $ eventInfo ->getType ()) {
106
118
$ this ->eventDispatcher ->dispatch (ConstEventsNames::XID , (new XidEvent ($ eventInfo , $ binaryDataReader ))->makeXidDTO ());
107
119
} elseif (ConstEventType::ROTATE_EVENT === $ eventInfo ->getType ()) {
0 commit comments