Skip to content

Commit

Permalink
Fix Creation of dynamic property warning in PHP 8.2 (#501)
Browse files Browse the repository at this point in the history
* Fix `Creation of dynamic property` warning in PHP 8.2

* Update IlluminateSnappyPdf.php
  • Loading branch information
JayBizzle authored Apr 7, 2023
1 parent 283d9c9 commit 940eec2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/IlluminateSnappyPdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
use Illuminate\Filesystem\Filesystem;

class IlluminateSnappyPdf extends Pdf {
/**
* @var \Illuminate\Filesystem\Filesystem
*/
protected $fs;

/**
* @param \Illuminate\Filesystem\Filesystem
Expand Down Expand Up @@ -101,4 +105,4 @@ protected function mkdir($pathname)
return $this->fs->makeDirectory($pathname, 0777, true, true);
}

}
}
9 changes: 9 additions & 0 deletions src/PdfWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ class PdfWrapper{
* @var array
*/
protected $options = array();

/**
* @var string
*/
protected $html;

/**
* @var string
*/
protected $file;

/**
* @param \Knp\Snappy\Pdf $snappy
Expand Down

1 comment on commit 940eec2

@chris2244
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$pdf = PDF::loadView($template, ['invoice' => $request->invoice, 'account' => $account]);
$pdf->generateFromHtml($pdf->html, $request->pdf_filename, [], true);

protected $html broke this.. is there a getter or better approach?

Please sign in to comment.