public static function isAppRegistered(?string $app = null): bool
    {
        self::initialize();
        if ($app === null) {
            $app = '*';
        }
        return isset(self::$repositories[$app]);
    }