mirror of
https://github.com/flarum/core.git
synced 2025-10-12 23:44:27 +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:
@@ -15,7 +15,7 @@ use Flarum\Formatter\Event\Configuring;
|
||||
use Illuminate\Contracts\Container\Container;
|
||||
use Illuminate\Events\Dispatcher;
|
||||
|
||||
class FormatterConfiguration implements Extender
|
||||
class FormatterConfiguration
|
||||
{
|
||||
protected $callback;
|
||||
|
||||
@@ -24,7 +24,7 @@ class FormatterConfiguration implements Extender
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
public function apply(Container $container)
|
||||
public function __invoke(Container $container)
|
||||
{
|
||||
$container->make(Dispatcher::class)->listen(
|
||||
Configuring::class,
|
||||
|
Reference in New Issue
Block a user