mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-21 18:36:40 +00:00
CrashDump: do not assign possibly-false return value of fopen() directly to non-union field
this would become a problem with typed properties, and also phpstan level 7 doesn't like it.
This commit is contained in:
parent
9c86763322
commit
5c7b05c2ba
@ -117,10 +117,11 @@ class CrashDump{
|
||||
mkdir($this->server->getDataPath() . "crashdumps");
|
||||
}
|
||||
$this->path = $this->server->getDataPath() . "crashdumps/" . date("D_M_j-H.i.s-T_Y", $this->time) . ".log";
|
||||
$this->fp = @fopen($this->path, "wb");
|
||||
if(!is_resource($this->fp)){
|
||||
$fp = @fopen($this->path, "wb");
|
||||
if(!is_resource($fp)){
|
||||
throw new \RuntimeException("Could not create Crash Dump");
|
||||
}
|
||||
$this->fp = $fp;
|
||||
$this->data["format_version"] = self::FORMAT_VERSION;
|
||||
$this->data["time"] = $this->time;
|
||||
$this->addLine($this->server->getName() . " Crash Dump " . date("D M j H:i:s T Y", $this->time));
|
||||
|
Loading…
x
Reference in New Issue
Block a user