| Conditions | 4 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Anomaly\PreferencesModule\Preference\Listener\Command; |
||
| 28 | function handle(Application $app, Repository $config, Request $request, PreferenceRepositoryInterface $preferences) |
||
|
|
|||
| 29 | { |
||
| 30 | if (!defined('LOCALE') && $locale = $preferences->value( |
||
| 31 | 'streams::' . ($request->segment(1) == 'admin' ? 'admin' : 'public') . '_locale' |
||
| 32 | ) |
||
| 33 | ) { |
||
| 34 | define('LOCALE', $locale); |
||
| 35 | $app->setLocale($locale); |
||
| 36 | $config->set('app.locale', $locale); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.