mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
CrashDump: do not assume that file() always returns array
phpstan level 7 prep
This commit is contained in:
parent
47c7872c88
commit
35490ca41c
@ -288,9 +288,11 @@ class CrashDump{
|
|||||||
|
|
||||||
if($this->server->getProperty("auto-report.send-code", true) !== false and file_exists($error["fullFile"])){
|
if($this->server->getProperty("auto-report.send-code", true) !== false and file_exists($error["fullFile"])){
|
||||||
$file = @file($error["fullFile"], FILE_IGNORE_NEW_LINES);
|
$file = @file($error["fullFile"], FILE_IGNORE_NEW_LINES);
|
||||||
for($l = max(0, $error["line"] - 10); $l < $error["line"] + 10 and isset($file[$l]); ++$l){
|
if($file !== false){
|
||||||
$this->addLine("[" . ($l + 1) . "] " . $file[$l]);
|
for($l = max(0, $error["line"] - 10); $l < $error["line"] + 10 and isset($file[$l]); ++$l){
|
||||||
$this->data["code"][$l + 1] = $file[$l];
|
$this->addLine("[" . ($l + 1) . "] " . $file[$l]);
|
||||||
|
$this->data["code"][$l + 1] = $file[$l];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user