77use Predis \Client as PredisClient ;
88use Rancoud \Database \Configurator ;
99use Rancoud \Database \Database as DB ;
10- use SessionHandler ;
11- use SessionHandlerInterface ;
1210
1311/**
1412 * Class DriverManager.
1513 */
1614abstract class DriverManager
1715{
18- protected static ?SessionHandlerInterface $ driver = null ;
16+ protected static ?\ SessionHandlerInterface $ driver = null ;
1917
2018 /** @throws SessionException */
2119 abstract protected static function throwExceptionIfHasStarted ();
2220
2321 abstract protected static function getLifetimeForRedis ();
2422
25- /**
26- * @throws SessionException
27- */
23+ /** @throws SessionException */
2824 protected static function configureDriver (): void
2925 {
3026 if (empty (static ::$ driver )) {
3127 static ::useDefaultDriver ();
3228 }
3329 }
3430
35- /**
36- * @throws SessionException
37- */
31+ /** @throws SessionException */
3832 public static function useDefaultDriver (): void
3933 {
4034 static ::throwExceptionIfHasStarted ();
4135
42- static ::$ driver = new SessionHandler ();
36+ static ::$ driver = new \ SessionHandler ();
4337 }
4438
45- /**
46- * @throws SessionException
47- */
39+ /** @throws SessionException */
4840 public static function useDefaultEncryptionDriver (string $ key , ?string $ method = null ): void
4941 {
5042 static ::throwExceptionIfHasStarted ();
@@ -55,19 +47,15 @@ public static function useDefaultEncryptionDriver(string $key, ?string $method =
5547 static ::$ driver = $ driver ;
5648 }
5749
58- /**
59- * @throws SessionException
60- */
50+ /** @throws SessionException */
6151 public static function useFileDriver (): void
6252 {
6353 static ::throwExceptionIfHasStarted ();
6454
6555 static ::$ driver = new File ();
6656 }
6757
68- /**
69- * @throws SessionException
70- */
58+ /** @throws SessionException */
7159 public static function useFileEncryptionDriver (string $ key , ?string $ method = null ): void
7260 {
7361 static ::throwExceptionIfHasStarted ();
@@ -79,7 +67,7 @@ public static function useFileEncryptionDriver(string $key, ?string $method = nu
7967 }
8068
8169 /**
82- * @param Configurator| array $configuration
70+ * @param array|Configurator $configuration
8371 *
8472 * @throws SessionException
8573 */
@@ -93,9 +81,7 @@ public static function useNewDatabaseDriver($configuration): void
9381 static ::$ driver = $ driver ;
9482 }
9583
96- /**
97- * @throws SessionException
98- */
84+ /** @throws SessionException */
9985 public static function useCurrentDatabaseDriver (DB $ databaseInstance ): void
10086 {
10187 static ::throwExceptionIfHasStarted ();
@@ -107,7 +93,7 @@ public static function useCurrentDatabaseDriver(DB $databaseInstance): void
10793 }
10894
10995 /**
110- * @param Configurator| array $configuration
96+ * @param array|Configurator $configuration
11197 *
11298 * @throws SessionException
11399 */
@@ -122,9 +108,7 @@ public static function useNewDatabaseEncryptionDriver($configuration, string $ke
122108 static ::$ driver = $ driver ;
123109 }
124110
125- /**
126- * @throws SessionException
127- */
111+ /** @throws SessionException */
128112 public static function useCurrentDatabaseEncryptionDriver (DB $ databaseInstance , string $ key , ?string $ method = null ): void // phpcs:ignore
129113 {
130114 static ::throwExceptionIfHasStarted ();
@@ -152,9 +136,7 @@ public static function useNewRedisDriver($configuration): void
152136 static ::$ driver = $ driver ;
153137 }
154138
155- /**
156- * @throws SessionException
157- */
139+ /** @throws SessionException */
158140 public static function useCurrentRedisDriver (PredisClient $ redisInstance ): void
159141 {
160142 static ::throwExceptionIfHasStarted ();
@@ -183,9 +165,7 @@ public static function useNewRedisEncryptionDriver($configuration, string $key,
183165 static ::$ driver = $ driver ;
184166 }
185167
186- /**
187- * @throws SessionException
188- */
168+ /** @throws SessionException */
189169 public static function useCurrentRedisEncryptionDriver (PredisClient $ redisInstance , string $ key , ?string $ method = null ): void // phpcs:ignore
190170 {
191171 static ::throwExceptionIfHasStarted ();
@@ -213,17 +193,15 @@ private static function setKeyAndMethod($driver, string $key, ?string $method):
213193 }
214194 }
215195
216- /**
217- * @throws SessionException
218- */
219- public static function useCustomDriver (SessionHandlerInterface $ customDriver ): void
196+ /** @throws SessionException */
197+ public static function useCustomDriver (\SessionHandlerInterface $ customDriver ): void
220198 {
221199 static ::throwExceptionIfHasStarted ();
222200
223201 static ::$ driver = $ customDriver ;
224202 }
225203
226- public static function getDriver (): SessionHandlerInterface
204+ public static function getDriver (): \ SessionHandlerInterface
227205 {
228206 return static ::$ driver ;
229207 }
0 commit comments