Convert SessionManager to a factory class
This commit is contained in:
parent
5b0ee7651b
commit
de8c5e5dc7
10 changed files with 64 additions and 52 deletions
|
@ -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');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue