\DrupalMailHandler::send not compatible with MailHandler::send
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3246910. --> Reported by: [thony](https://www.drupal.org/user/3647390) >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>Hello ! When I throw any drush command with monolog enabled I get:<br> PHP Fatal error: Declaration of Drupal\monolog\Logger\Handler\DrupalMailHandler::send(string $content, array $records) must be compatible with Monolog\Handler\MailHandler::send(string $content, array $records): void in /var/www/isofrance-fenetres-energies.l/web/modules/contrib/monolog/src/Logger/Handler/DrupalMailHandler.php on line 31</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>If I add the ":void" to DrupalMailHandler::send the error goes away.</p> <p>I suppose it comes from my php version ?</p> <p>php -v<br> PHP 7.4.3 (cli) (built: Oct 25 2021 18:20:54) ( NTS )<br> Copyright (c) The PHP Group<br> Zend Engine v3.4.0, Copyright (c) Zend Technologies<br> with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies<br> with Xdebug v2.9.2, Copyright (c) 2002-2020, by Derick Rethans</p>
issue