File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1717use Evenement \EventEmitterTrait ;
1818use Exception ;
1919use RuntimeException ;
20+ use function array_key_exists ;
2021use function count ;
2122use function in_array ;
2223use function array_key_first ;
@@ -423,6 +424,12 @@ public function unserialize($data)
423424 * @throws Exception
424425 */
425426 public function __unserialize (array $ data ) {
427+ //Detect old serialisation format
428+ if (count ($ data ) === 1 && array_key_exists ('data ' , $ data )) {
429+ $ this ->unserialize ($ data ['data ' ]);
430+ return ;
431+ }
432+
426433 $ this ->unresolved_events = $ data ['events ' ];
427434
428435 $ this ->instanceId = $ data ['instanceId ' ] ?? $ this ->generateInstanceId (); //Generate a new ID if we don't have one serialized
@@ -442,4 +449,4 @@ public function resolveEvents($events)
442449 $ this ->consumedEvents = array_map (function ($ event_id ) use ($ events ) { return $ events [$ event_id ]; } , $ this ->unresolved_events );
443450 unset($ this ->unresolved_events );
444451 }
445- }
452+ }
You can’t perform that action at this time.
0 commit comments