PHP8 phpstan fix (#13843)

This commit is contained in:
Tony Murray
2022-03-11 10:38:31 -06:00
committed by GitHub
parent e280ea1c8d
commit 19e0ad604a
2 changed files with 4 additions and 8 deletions
@@ -29,11 +29,12 @@ use Throwable;
class FileWriteFailedException extends \Exception
{
protected $file;
/** @var string */
protected $file_path;
public function __construct($file, $code = 0, Throwable $previous = null)
{
$this->file = $file;
$this->file_path = $file;
parent::__construct("Failed to write file: $file", $code, $previous);
}
@@ -45,7 +46,7 @@ class FileWriteFailedException extends \Exception
public function render(\Illuminate\Http\Request $request)
{
$title = trans('exceptions.file_write_failed.title');
$message = trans('exceptions.file_write_failed.message', ['file' => $this->file]);
$message = trans('exceptions.file_write_failed.message', ['file' => $this->file_path]);
return $request->wantsJson() ? response()->json([
'status' => 'error',
-5
View File
@@ -2670,11 +2670,6 @@ parameters:
count: 1
path: LibreNMS/Exceptions/FileWriteFailedException.php
-
message: "#^Property LibreNMS\\\\Exceptions\\\\FileWriteFailedException\\:\\:\\$file has no type specified\\.$#"
count: 1
path: LibreNMS/Exceptions/FileWriteFailedException.php
-
message: "#^Method LibreNMS\\\\Exceptions\\\\HostUnreachableException\\:\\:addReason\\(\\) has no return type specified\\.$#"
count: 1