diff --git a/CHANGELOG-5.x.md b/CHANGELOG-5.x.md index c11e6fe325..6bcb9a27bf 100644 --- a/CHANGELOG-5.x.md +++ b/CHANGELOG-5.x.md @@ -1,3 +1,7 @@ +#### 5.3.2 + +* Rollback getSubscribedEvents Extension refactor by @TavoNiievez in #6862 + #### 5.3.1 * Issue 6857: Update Actor::__call() to have return type 'mixed' by @troy-rudolph in #6858 diff --git a/ext/SuiteInitSubscriberTrait.php b/ext/SuiteInitSubscriberTrait.php index cb20fea80b..525b9de5fc 100644 --- a/ext/SuiteInitSubscriberTrait.php +++ b/ext/SuiteInitSubscriberTrait.php @@ -12,14 +12,17 @@ trait SuiteInitSubscriberTrait { public static function getSubscribedEvents(): array { - $events = property_exists(static::class, 'events') && is_array(static::$events) - ? static::$events - : []; - - $suiteInit = (array) ($events[Events::SUITE_INIT] ?? []); - $suiteInit[] = 'receiveModuleContainer'; - $events[Events::SUITE_INIT] = $suiteInit; - - return $events; + if (!isset(static::$events)) { + return [Events::SUITE_INIT => 'receiveModuleContainer']; + } + if (isset(static::$events[Events::SUITE_INIT])) { + if (!is_array(static::$events[Events::SUITE_INIT])) { + static::$events[Events::SUITE_INIT] = [[static::$events[Events::SUITE_INIT]]]; + } + static::$events[Events::SUITE_INIT][] = ['receiveModuleContainer']; + } else { + static::$events[Events::SUITE_INIT] = 'receiveModuleContainer'; + } + return static::$events; } } diff --git a/src/Codeception/Codecept.php b/src/Codeception/Codecept.php index 77df61b93c..d4f8d4202d 100644 --- a/src/Codeception/Codecept.php +++ b/src/Codeception/Codecept.php @@ -36,7 +36,7 @@ class Codecept /** * @var string */ - public const VERSION = '5.3.1'; + public const VERSION = '5.3.2'; protected ResultAggregator $resultAggregator;