1
0
mirror of https://github.com/flarum/core.git synced 2025-08-07 08:56:38 +02:00

Tweak extender interface in preparation for adding more methods

This commit is contained in:
Franz Liedke
2018-09-26 22:36:36 +02:00
parent e3afb38427
commit 3c827d2fce
9 changed files with 9 additions and 9 deletions

View File

@@ -32,7 +32,7 @@ class Compat implements ExtenderInterface
$this->callback = $callback; $this->callback = $callback;
} }
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
$container->call($this->callback); $container->call($this->callback);
} }

View File

@@ -16,5 +16,5 @@ use Illuminate\Contracts\Container\Container;
interface ExtenderInterface interface ExtenderInterface
{ {
public function __invoke(Container $container, Extension $extension = null); public function extend(Container $container, Extension $extension = null);
} }

View File

@@ -30,7 +30,7 @@ class Formatter implements ExtenderInterface
return $this; return $this;
} }
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
$events = $container->make(Dispatcher::class); $events = $container->make(Dispatcher::class);

View File

@@ -51,7 +51,7 @@ class Frontend implements ExtenderInterface
return $this; return $this;
} }
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
$this->registerAssets($container, $this->getModuleName($extension)); $this->registerAssets($container, $this->getModuleName($extension));
$this->registerRoutes($container); $this->registerRoutes($container);

View File

@@ -20,7 +20,7 @@ use RuntimeException;
class LanguagePack implements ExtenderInterface class LanguagePack implements ExtenderInterface
{ {
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
if (is_null($extension)) { if (is_null($extension)) {
throw new InvalidArgumentException( throw new InvalidArgumentException(

View File

@@ -25,7 +25,7 @@ class Locales implements ExtenderInterface
$this->directory = $directory; $this->directory = $directory;
} }
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
/** @var LocaleManager $locales */ /** @var LocaleManager $locales */
$locales = $container->make(LocaleManager::class); $locales = $container->make(LocaleManager::class);

View File

@@ -63,7 +63,7 @@ class Routes implements ExtenderInterface
return $this; return $this;
} }
public function __invoke(Container $container, Extension $extension = null) public function extend(Container $container, Extension $extension = null)
{ {
if (empty($this->routes)) { if (empty($this->routes)) {
return; return;

View File

@@ -121,7 +121,7 @@ class Extension implements Arrayable
$extender = new Compat($extender); $extender = new Compat($extender);
} }
$extender($app, $this); $extender->extend($app, $this);
} }
} }

View File

@@ -173,7 +173,7 @@ class InstalledSite implements SiteInterface
$laravel->boot(); $laravel->boot();
foreach ($this->extenders as $extension) { foreach ($this->extenders as $extension) {
$extension($laravel); $extension->extend($laravel);
} }
return $laravel; return $laravel;