Conditions | 2 |
Paths | 2 |
Total Lines | 33 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php namespace App\Listeners; |
||
10 | public function handle(Booted $event) |
||
|
|||
11 | { |
||
12 | app()->singleton( |
||
13 | 'translation.loader', |
||
14 | function ($application) { |
||
15 | return new Loader($application['files'], $application['path.lang']); |
||
16 | } |
||
17 | ); |
||
18 | |||
19 | app()->singleton( |
||
20 | 'translator', |
||
21 | function ($application) { |
||
22 | $loader = $application->make('translation.loader'); |
||
23 | |||
24 | // When registering the translator component, we'll need to set the default |
||
25 | // locale as well as the fallback locale. So, we'll grab the application |
||
26 | // configuration so we can easily get both of these values from there. |
||
27 | $locale = $application['config']['app.locale']; |
||
28 | |||
29 | $trans = new Translator($loader, $locale); |
||
30 | |||
31 | $trans->setFallback($application['config']['app.fallback_locale']); |
||
32 | |||
33 | return $trans; |
||
34 | } |
||
35 | ); |
||
36 | |||
37 | if (defined('LOCALE')) { |
||
38 | app()->setLocale(LOCALE); |
||
39 | config()->set('app.locale', LOCALE); |
||
40 | } |
||
41 | // Set our locale namespace. |
||
42 | app()->make('translator')->addNamespace('streams', realpath(__DIR__ . '/../../vendor/visiosoft/streams-platform/resources/lang')); |
||
43 | |||
46 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.