@@ -67,13 +67,13 @@ class StorageEngine
6767 public function __construct (string $ engine )
6868 {
6969 $ storageEngines = self ::getStorageEngines ();
70- if (empty ( $ storageEngines [ $ engine] )) {
70+ if (! array_key_exists ( $ engine, $ storageEngines )) {
7171 return ;
7272 }
7373
7474 $ this ->engine = $ engine ;
7575 $ this ->title = $ storageEngines [$ engine ]['Engine ' ];
76- $ this ->comment = $ storageEngines [$ engine ]['Comment ' ] ?? '' ;
76+ $ this ->comment = $ storageEngines [$ engine ]['Comment ' ];
7777 $ this ->support = match ($ storageEngines [$ engine ]['Support ' ]) {
7878 'DEFAULT ' => self ::SUPPORT_DEFAULT ,
7979 'YES ' => self ::SUPPORT_YES ,
@@ -85,7 +85,7 @@ public function __construct(string $engine)
8585 /**
8686 * Returns array of storage engines
8787 *
88- * @return mixed[][] array of storage engines
88+ * @return array<string, array{Engine: string, Comment: string, Support: string}>
8989 *
9090 * @staticvar array $storage_engines storage engines
9191 */
@@ -95,6 +95,7 @@ public static function getStorageEngines(): array
9595
9696 if ($ storageEngines == null ) {
9797 $ dbi = DatabaseInterface::getInstance ();
98+ /** @var array<string, array{Engine: string, Comment: string, Support: string}> $storageEngines */
9899 $ storageEngines = $ dbi ->fetchResult ('SHOW STORAGE ENGINES ' , 'Engine ' );
99100 if (! $ dbi ->isMariaDB () && $ dbi ->getVersion () >= 50708 ) {
100101 $ disabled = (string ) SessionCache::get (
@@ -269,9 +270,7 @@ public static function isValid(string $engine): bool
269270 return true ;
270271 }
271272
272- $ storageEngines = self ::getStorageEngines ();
273-
274- return isset ($ storageEngines [$ engine ]);
273+ return array_key_exists ($ engine , self ::getStorageEngines ());
275274 }
276275
277276 /**
0 commit comments