mirror of
https://github.com/flarum/core.git
synced 2025-07-25 18:51:40 +02:00
Turn extenders into callables
This simplifies the API and gives extension developers more flexibility, for a) maintaining backwards compatibility, and b) doing advanced stuff that extenders do not allow. Note that only extenders are guaranteed to work across different versions of Flarum (once the API surface is stable). See the discussion in https://github.com/flarum/core/pull/1335.
This commit is contained in:
@@ -24,11 +24,11 @@ class ExtensionServiceProvider extends AbstractServiceProvider
|
||||
$this->app->bind('flarum.extensions', ExtensionManager::class);
|
||||
|
||||
$this->app->booting(function (Container $app) {
|
||||
/** @var \Flarum\Extend\Extender[] $extenders */
|
||||
/** @var callable[] $extenders */
|
||||
$extenders = $app->make('flarum.extensions')->getActiveExtenders();
|
||||
|
||||
foreach ($extenders as $extender) {
|
||||
$extender->apply($app);
|
||||
$app->call($extender);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user