Skip to content

Commit

Permalink
Keep original eventDispatcher when combining and other does not have …
Browse files Browse the repository at this point in the history
…any defined
  • Loading branch information
Chemaclass committed Jul 29, 2023
1 parent 369ff30 commit 165a62d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/Framework/Bootstrap/SetupCombinator.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Gacela\Framework\Bootstrap;

use Gacela\Framework\Event\Dispatcher\ConfigurableEventDispatcher;
use Gacela\Framework\Event\Dispatcher\NullEventDispatcher;

/**
* @psalm-suppress MixedArgumentTypeCoercion
Expand Down Expand Up @@ -88,7 +87,7 @@ private function combineEventDispatcher(SetupGacela $other): void
}
}
} else {
$eventDispatcher = new NullEventDispatcher();
$eventDispatcher = $this->original->getEventDispatcher();
}
$this->original->setEventDispatcher($eventDispatcher);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ public function test_with_project_cached_enabled(): void
{
Config::getInstance()
->getSetupGacela()
->combine(SetupGacela::fromCallable(function (GacelaConfig $config): void {
->combine(SetupGacela::fromCallable(static function (GacelaConfig $config): void {
$config->enableFileCache();
$config->registerGenericListener([$this, 'saveInMemoryEvent']);
}));

DocBlockResolverCache::getCacheInstance();
Expand Down

0 comments on commit 165a62d

Please sign in to comment.