1
0
mirror of https://github.com/flarum/core.git synced 2025-08-14 12:24:33 +02:00

Cleanup code, typehints and class references

This commit is contained in:
Franz Liedke
2017-07-02 13:29:30 +02:00
parent e46b3d54d1
commit 4aad7c1040
23 changed files with 87 additions and 69 deletions

View File

@@ -15,6 +15,8 @@ use Flarum\Event\ConfigureLocales;
use Flarum\Foundation\AbstractServiceProvider;
use Illuminate\Contracts\Events\Dispatcher;
use Symfony\Component\Translation\MessageSelector;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\TranslatorInterface;
class LocaleServiceProvider extends AbstractServiceProvider
{
@@ -35,8 +37,8 @@ class LocaleServiceProvider extends AbstractServiceProvider
*/
public function register()
{
$this->app->singleton('Flarum\Locale\LocaleManager');
$this->app->alias('Flarum\Locale\LocaleManager', 'flarum.localeManager');
$this->app->singleton(LocaleManager::class);
$this->app->alias(LocaleManager::class, 'flarum.localeManager');
$this->app->singleton('translator', function () {
$defaultLocale = $this->getDefaultLocale();
@@ -47,8 +49,8 @@ class LocaleServiceProvider extends AbstractServiceProvider
return $translator;
});
$this->app->alias('translator', 'Symfony\Component\Translation\Translator');
$this->app->alias('translator', 'Symfony\Component\Translation\TranslatorInterface');
$this->app->alias('translator', Translator::class);
$this->app->alias('translator', TranslatorInterface::class);
}
private function getDefaultLocale()