- <?php
- declare(strict_types=1);
- namespace Slivki\Services\City;
- use Slivki\Entity\City;
- use Symfony\Component\HttpFoundation\Session\SessionInterface;
- final class CityProvider
- {
-     private int $defaultCityId;
-     private SessionInterface $session;
-     public function __construct(int $defaultCityId, SessionInterface $session)
-     {
-         $this->defaultCityId = $defaultCityId;
-         $this->session = $session;
-     }
-     public function getDefaultCityId(): int
-     {
-         return $this->defaultCityId;
-     }
-     public function getCurrentCityId(): int
-     {
-         return (int) $this->session->get(City::CITY_ID_SESSION_KEY, $this->defaultCityId);
-     }
- }
-