Currently, after an upgrade of nextcloud to version 29.0.3 I am facing the following error:
PHP Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in /var/www/[censored]/cron.php on line 187
which is the following part in the cron:
if ($timeSpent > $cronInterval) {
$logLevel = match (true) {
$timeSpent > $cronInterval * 128 => \OCP\ILogger::FATAL,
$timeSpent > $cronInterval * 64 => \OCP\ILogger::ERROR,
$timeSpent > $cronInterval * 16 => \OCP\ILogger::WARN,
$timeSpent > $cronInterval * 8 => \OCP\ILogger::INFO,
default => \OCP\ILogger::DEBUG,
};
$logger->log(
$logLevel,
'Background job ' . $jobDetails . ' ran for ' . $timeSpent . ' seconds',
['app' => 'cron']
);
}
to be exact with the following line:
$timeSpent > $cronInterval * 128 => \OCP\ILogger::FATAL,
Any ideas why this occurs? PHP is Version 8.1 FPM.