Don't use the Config facade in the TimezoneLocaleComposer
This commit is contained in:
@@ -13,11 +13,30 @@ namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Illuminate\Contracts\Config\Repository;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Config;
|
||||
|
||||
class TimezoneLocaleComposer
|
||||
{
|
||||
/**
|
||||
* The illuminate config instance.
|
||||
*
|
||||
* @var \Illuminate\Contracts\Config\Repository
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* Create a new timezone locale composer.
|
||||
*
|
||||
* @param \Illuminate\Contracts\Config\Repository $config
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timezones and Locales composer.
|
||||
*
|
||||
@@ -27,7 +46,7 @@ class TimezoneLocaleComposer
|
||||
*/
|
||||
public function compose(View $view)
|
||||
{
|
||||
$enabledLangs = Config::get('langs');
|
||||
$enabledLangs = $this->config->get('langs');
|
||||
|
||||
$langs = array_map(function ($lang) use ($enabledLangs) {
|
||||
$locale = basename($lang);
|
||||
|
||||
Reference in New Issue
Block a user