1
0
mirror of https://github.com/flarum/core.git synced 2025-08-15 12:54:47 +02:00

Get rid of some Application methods

These are not necessary to be available so broadly. In fact, they
seem to make it too easy to use them, which has lead to some sub-
optimal architecture decisions.

Their equivalents have been moved to the classes where used.
This commit is contained in:
Franz Liedke
2018-04-21 18:57:15 +02:00
parent 5b821b21b1
commit b4b72fe62f
3 changed files with 9 additions and 32 deletions

View File

@@ -13,6 +13,7 @@ namespace Flarum\Locale;
use Flarum\Event\ConfigureLocales;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Settings\SettingsRepositoryInterface;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Translation\Translator as TranslatorContract;
use Symfony\Component\Translation\MessageSelector;
@@ -54,8 +55,8 @@ class LocaleServiceProvider extends AbstractServiceProvider
private function getDefaultLocale(): string
{
return $this->app->isInstalled() && $this->app->isUpToDate()
? $this->app->make('flarum.settings')->get('default_locale', 'en')
: 'en';
$repo = $this->app->make(SettingsRepositoryInterface::class);
return $repo->get('default_locale', 'en');
}
}