Problem/Motivation
With PHP 8.1, when running cron error report as below:
Deprecated function: Return type of Drupal\xmlsitemap\XmlSitemapWriter::openUri($uri) should either be compatible with XMLWriter::openUri(string $uri): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 571 of vendor/composer/ClassLoader.php).
include('/var/www/html/core/includes/bootstrap.inc') (Line: 571)
Composer\Autoload\includeFile('/var/www/html/modules/contrib/xmlsitemap/src/XmlSitemapWriter.php') (Line: 428)
Composer\Autoload\ClassLoader->loadClass('Drupal\xmlsitemap\XmlSitemapWriter') (Line: 265)
Drupal\xmlsitemap\XmlSitemapGenerator->generatePage(Object, 1) (Line: 433)
Drupal\xmlsitemap\XmlSitemapGenerator->regenerateBatchGenerate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 2490)
xmlsitemap_regenerate_batch_generate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 295)
_batch_process() (Line: 954)
batch_process() (Line: 1520)
xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch') (Line: 202)
xmlsitemap_cron()
call_user_func_array('xmlsitemap_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'cron') (Line: 250)
Drupal\Core\Cron->invokeCronHandlers() (Line: 136)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 1868)
install_finished(Array) (Line: 700)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)
Deprecated function: Return type of Drupal\xmlsitemap\XmlSitemapWriter::startElement($name, $root = false) should either be compatible with XMLWriter::startElement(string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 571 of vendor/composer/ClassLoader.php).
include('/var/www/html/core/includes/bootstrap.inc') (Line: 571)
Composer\Autoload\includeFile('/var/www/html/modules/contrib/xmlsitemap/src/XmlSitemapWriter.php') (Line: 428)
Composer\Autoload\ClassLoader->loadClass('Drupal\xmlsitemap\XmlSitemapWriter') (Line: 265)
Drupal\xmlsitemap\XmlSitemapGenerator->generatePage(Object, 1) (Line: 433)
Drupal\xmlsitemap\XmlSitemapGenerator->regenerateBatchGenerate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 2490)
xmlsitemap_regenerate_batch_generate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 295)
_batch_process() (Line: 954)
batch_process() (Line: 1520)
xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch') (Line: 202)
xmlsitemap_cron()
call_user_func_array('xmlsitemap_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'cron') (Line: 250)
Drupal\Core\Cron->invokeCronHandlers() (Line: 136)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 1868)
install_finished(Array) (Line: 700)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)
Deprecated function: Return type of Drupal\xmlsitemap\XmlSitemapWriter::writeElement($name, $content = null) should either be compatible with XMLWriter::writeElement(string $name, ?string $content = null): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 571 of vendor/composer/ClassLoader.php).
include('/var/www/html/core/includes/bootstrap.inc') (Line: 571)
Composer\Autoload\includeFile('/var/www/html/modules/contrib/xmlsitemap/src/XmlSitemapWriter.php') (Line: 428)
Composer\Autoload\ClassLoader->loadClass('Drupal\xmlsitemap\XmlSitemapWriter') (Line: 265)
Drupal\xmlsitemap\XmlSitemapGenerator->generatePage(Object, 1) (Line: 433)
Drupal\xmlsitemap\XmlSitemapGenerator->regenerateBatchGenerate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 2490)
xmlsitemap_regenerate_batch_generate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 295)
_batch_process() (Line: 954)
batch_process() (Line: 1520)
xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch') (Line: 202)
xmlsitemap_cron()
call_user_func_array('xmlsitemap_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'cron') (Line: 250)
Drupal\Core\Cron->invokeCronHandlers() (Line: 136)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 1868)
install_finished(Array) (Line: 700)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)
Deprecated function: Return type of Drupal\xmlsitemap\XmlSitemapWriter::startDocument($version = '1.0', $encoding = 'UTF-8', $standalone = null) should either be compatible with XMLWriter::startDocument(?string $version = "1.0", ?string $encoding = null, ?string $standalone = null): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 571 of vendor/composer/ClassLoader.php).
include('/var/www/html/core/includes/bootstrap.inc') (Line: 571)
Composer\Autoload\includeFile('/var/www/html/modules/contrib/xmlsitemap/src/XmlSitemapWriter.php') (Line: 428)
Composer\Autoload\ClassLoader->loadClass('Drupal\xmlsitemap\XmlSitemapWriter') (Line: 265)
Drupal\xmlsitemap\XmlSitemapGenerator->generatePage(Object, 1) (Line: 433)
Drupal\xmlsitemap\XmlSitemapGenerator->regenerateBatchGenerate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 2490)
xmlsitemap_regenerate_batch_generate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 295)
_batch_process() (Line: 954)
batch_process() (Line: 1520)
xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch') (Line: 202)
xmlsitemap_cron()
call_user_func_array('xmlsitemap_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'cron') (Line: 250)
Drupal\Core\Cron->invokeCronHandlers() (Line: 136)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 1868)
install_finished(Array) (Line: 700)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)
Deprecated function: Return type of Drupal\xmlsitemap\XmlSitemapWriter::endDocument() should either be compatible with XMLWriter::endDocument(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in include() (line 571 of vendor/composer/ClassLoader.php).
include('/var/www/html/core/includes/bootstrap.inc') (Line: 571)
Composer\Autoload\includeFile('/var/www/html/modules/contrib/xmlsitemap/src/XmlSitemapWriter.php') (Line: 428)
Composer\Autoload\ClassLoader->loadClass('Drupal\xmlsitemap\XmlSitemapWriter') (Line: 265)
Drupal\xmlsitemap\XmlSitemapGenerator->generatePage(Object, 1) (Line: 433)
Drupal\xmlsitemap\XmlSitemapGenerator->regenerateBatchGenerate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 2490)
xmlsitemap_regenerate_batch_generate('4uxqWRxEfvNUZy0HT1zwX8XhbUwhdCe_8g86co5Zl4I', Array) (Line: 295)
_batch_process() (Line: 954)
batch_process() (Line: 1520)
xmlsitemap_run_unprogressive_batch('xmlsitemap_regenerate_batch') (Line: 202)
xmlsitemap_cron()
call_user_func_array('xmlsitemap_cron', Array) (Line: 392)
Drupal\Core\Extension\ModuleHandler->invoke('xmlsitemap', 'cron') (Line: 250)
Drupal\Core\Cron->invokeCronHandlers() (Line: 136)
Drupal\Core\Cron->run() (Line: 75)
Drupal\Core\ProxyClass\Cron->run() (Line: 1868)
install_finished(Array) (Line: 700)
install_run_task(Array, Array) (Line: 571)
install_run_tasks(Array, NULL) (Line: 119)
install_drupal(Object) (Line: 48)