Instead of calling throw new \RuntimeException and letting the fatel error handle show a message, call wp_die directly.
Like this
function wp_cache_init() {
$message = WP_Object_Cache::has_sqlite();
if ( true === $message ) {
// We need to override this WordPress global in order to inject our cache.
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$GLOBALS['wp_object_cache'] = new WP_Object_Cache();
} else {
wp_die( $message );
}
}
Instead of calling
throw new \RuntimeException
and letting the fatel error handle show a message, callwp_die
directly.Like this