1
0
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:
Franz Liedke
2018-01-09 20:49:51 +01:00
parent 714775cfed
commit 1ce70eeb6e
7 changed files with 12 additions and 31 deletions

View File

@@ -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);
}
});
}