Server: fixed PHPStan level 7 error in crashDump()

This commit is contained in:
Dylan K. Taylor 2021-12-07 23:06:10 +00:00
parent 503c888838
commit bf29409a45
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -1564,7 +1564,7 @@ class Server{
$stamp = Path::join($this->getDataPath(), "crashdumps", ".last_crash");
$crashInterval = 120; //2 minutes
if(file_exists($stamp) and !($report = (filemtime($stamp) + $crashInterval < time()))){
if(($lastReportTime = @filemtime($stamp)) !== false and !($report = ($lastReportTime + $crashInterval < time()))){
$this->logger->debug("Not sending crashdump due to last crash less than $crashInterval seconds ago");
}
@touch($stamp); //update file timestamp