mirror of
https://github.com/flarum/core.git
synced 2025-07-23 09:41:26 +02:00
Tweak extender interface in preparation for adding more methods
This commit is contained in:
@@ -32,7 +32,7 @@ class Compat implements ExtenderInterface
|
||||
$this->callback = $callback;
|
||||
}
|
||||
|
||||
public function __invoke(Container $container, Extension $extension = null)
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
$container->call($this->callback);
|
||||
}
|
||||
|
@@ -16,5 +16,5 @@ use Illuminate\Contracts\Container\Container;
|
||||
|
||||
interface ExtenderInterface
|
||||
{
|
||||
public function __invoke(Container $container, Extension $extension = null);
|
||||
public function extend(Container $container, Extension $extension = null);
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ class Formatter implements ExtenderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __invoke(Container $container, Extension $extension = null)
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
$events = $container->make(Dispatcher::class);
|
||||
|
||||
|
@@ -51,7 +51,7 @@ class Frontend implements ExtenderInterface
|
||||
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->registerRoutes($container);
|
||||
|
@@ -20,7 +20,7 @@ use RuntimeException;
|
||||
|
||||
class LanguagePack implements ExtenderInterface
|
||||
{
|
||||
public function __invoke(Container $container, Extension $extension = null)
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
if (is_null($extension)) {
|
||||
throw new InvalidArgumentException(
|
||||
|
@@ -25,7 +25,7 @@ class Locales implements ExtenderInterface
|
||||
$this->directory = $directory;
|
||||
}
|
||||
|
||||
public function __invoke(Container $container, Extension $extension = null)
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
/** @var LocaleManager $locales */
|
||||
$locales = $container->make(LocaleManager::class);
|
||||
|
@@ -63,7 +63,7 @@ class Routes implements ExtenderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __invoke(Container $container, Extension $extension = null)
|
||||
public function extend(Container $container, Extension $extension = null)
|
||||
{
|
||||
if (empty($this->routes)) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user