I recently made a composer update to my site and now I encounter a strange error when using the mailer for password recovery. Here is what the debugger says :
in /home/denentza/association.denentzat.fr/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php at line 496
487488489490491492493494495496497498499500501502503504505
*
* @return int
*/
public function getPriority()
{
list($priority) = sscanf($this->getHeaderFieldModel('X-Priority'),
'%[1-5]'
);
return $priority ?? 3;
}
/**
* Ask for a delivery receipt from the recipient to be sent to $addresses.
*
* @param array $addresses
*
* @return $this
*/
2. yii\base\ErrorHandler::handleFatalError()
The error line that is highlighted is return $priority ?? 3;
I don't see what to do. Thank you for help.
Apparently the operator "??" is syntactic sugar for avoiding NULL
values (https://wiki.php.net/rfc/isset_ternary and php 7.0.x). To address this you should either upgrade to the latest PHP version. Alternatively you could change the code, but there is no guarantee that this or similar issues won't pop up in other segments of the library you are using.