Convert SessionManager to a factory class

This commit is contained in:
Pierre Rudloff 2020-10-21 22:47:15 +02:00
parent 5b0ee7651b
commit de8c5e5dc7
10 changed files with 64 additions and 52 deletions

View file

@ -7,6 +7,7 @@
namespace Alltube;
use Aura\Session\Segment;
use Aura\Session\Session;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\Loader\PoFileLoader;
@ -52,10 +53,10 @@ class LocaleManager
/**
* LocaleManager constructor.
* @param Session $session
*/
public function __construct()
public function __construct(Session $session)
{
$session = SessionManager::getSession();
$this->sessionSegment = $session->getSegment(self::class);
$cookieLocale = $this->sessionSegment->get('locale');