2121
2222use phpMyFAQ \Configuration ;
2323use phpMyFAQ \Core \Exception ;
24- use phpMyFAQ \Instance \Database \Driver ;
24+ use phpMyFAQ \Instance \Database \DriverInterface ;
2525
2626/**
2727 * Class Database
@@ -33,7 +33,7 @@ class Database
3333 /**
3434 * Instance.
3535 */
36- private static ?Driver $ driver = null ;
36+ private static ?DriverInterface $ driver = null ;
3737
3838 /**
3939 * DROP TABLE statements.
@@ -91,7 +91,7 @@ private function __construct(
9191 * @param string $type Database management system type
9292 * @throws Exception
9393 */
94- public static function factory (Configuration $ configuration , string $ type ): ?Driver
94+ public static function factory (Configuration $ configuration , string $ type ): ?DriverInterface
9595 {
9696 if (str_starts_with ($ type , 'pdo_ ' )) {
9797 $ class = 'phpMyFAQ\Instance\Database\Pdo ' . ucfirst (substr ($ type , 4 ));
@@ -111,9 +111,9 @@ public static function factory(Configuration $configuration, string $type): ?Dri
111111 /**
112112 * Returns the single instance.
113113 */
114- public static function getInstance (): ?Driver
114+ public static function getInstance (): ?DriverInterface
115115 {
116- if (!self ::$ driver instanceof Driver ) {
116+ if (!self ::$ driver instanceof DriverInterface ) {
117117 $ className = self ::class;
118118 self ::$ driver = new $ className ();
119119 }
0 commit comments