1212use wcf \system \application \IApplication ;
1313use wcf \system \benchmark \Benchmark ;
1414use wcf \system \box \BoxHandler ;
15- use wcf \system \cache \builder \CoreObjectCacheBuilder ;
1615use wcf \system \cache \builder \PackageUpdateCacheBuilder ;
16+ use wcf \system \cache \eager \CoreObjectCache ;
1717use wcf \system \database \MySQLDatabase ;
1818use wcf \system \event \EventHandler ;
1919use wcf \system \exception \ErrorException ;
2020use wcf \system \exception \IPrintableException ;
21- use wcf \system \exception \ParentClassException ;
2221use wcf \system \exception \SystemException ;
2322use wcf \system \language \LanguageFactory ;
2423use wcf \system \package \command \RebuildBootstrapper ;
@@ -140,9 +139,10 @@ class WCF
140139
141140 /**
142141 * list of cached core objects
143- * @var string[]
142+ *
143+ * @var array<string, class-string<SingletonFactory>>
144144 */
145- protected static $ coreObjectCache = [] ;
145+ protected static array $ coreObjectCache ;
146146
147147 /**
148148 * database object
@@ -752,7 +752,7 @@ protected function initCoreObjects(): void
752752 return ;
753753 }
754754
755- self ::$ coreObjectCache = CoreObjectCacheBuilder:: getInstance ()-> getData ();
755+ self ::$ coreObjectCache = ( new CoreObjectCache ())-> getCache ();
756756 }
757757
758758 /**
@@ -919,10 +919,6 @@ final public static function __callStatic(string $name, array $arguments)
919919 }
920920
921921 if (\class_exists ($ objectName )) {
922- if (!\is_subclass_of ($ objectName , SingletonFactory::class)) {
923- throw new ParentClassException ($ objectName , SingletonFactory::class);
924- }
925-
926922 self ::$ coreObject [$ className ] = \call_user_func ([$ objectName , 'getInstance ' ]);
927923
928924 return self ::$ coreObject [$ className ];
@@ -934,7 +930,7 @@ final public static function __callStatic(string $name, array $arguments)
934930 /**
935931 * Searches for cached core object definition.
936932 *
937- * @return string|null
933+ * @return class- string<SingletonFactory> |null
938934 */
939935 final protected static function getCoreObject (string $ className )
940936 {
0 commit comments