Monolog FileHandler compatibility issue breaks Wordpress plugin "Connect Matomo" (WP-Piwik)

Hello,
in the Wordpress debug.log I got following error after updating to Matomo 5.2.1:
PHP Fatal error: Declaration of Piwik\Plugins\Monolog\Handler\FileHandler::write(array $record) must be compatible with Monolog\Handler\StreamHandler::write(array $record): void in /home/******/public_html/statistiques/plugins/Monolog/Handler/FileHandler.php on line 23

The plugin Connect Matomo stopped working in the Wordpress backend.

The workaround was to add “void” as return type to the protected function write in the file /plugins/Monolog/Handler/FileHandler.php at line 23:

protected function write(array $record): void

The plugin Connect Matomo works again and the error message is gone.
Now there is only a File integrity error in Matomo diagnostics as the file size of FileHandler.php changed.

Is there another solution? Is this a bug in the Monolog plugin?

Thanks in advance,
Best regards
Dirk

Matomo: 5.2.1
Wordpress: 6.5.5
Connect Matomo plugin: 1.0.30
PHP Wordpress: 7.4.33
PHP Matomo: 8.1.31