Skip to content

Commit

Permalink
Merge pull request #815 from W0rma/php84
Browse files Browse the repository at this point in the history
Fix PHP 8.4 deprecation warnings
  • Loading branch information
spipu authored Dec 3, 2024
2 parents befc812 + de4a110 commit 5b145f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Html2Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ protected function getTagObject($tagName)
/**
* set the debug mode to On
*
* @param DebugInterface $debugObject
* @param DebugInterface|null $debugObject
*
* @return Html2Pdf $this
*/
public function setModeDebug(DebugInterface $debugObject = null)
public function setModeDebug($debugObject = null)
{
if (is_null($debugObject)) {
$this->debug = new Debug();
Expand Down
7 changes: 6 additions & 1 deletion src/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public static function load($code)
self::$list = array();
$handle = fopen($file, 'r');
while (!feof($handle)) {
$line = fgetcsv($handle);
if (PHP_VERSION >= 80400) {
// As of PHP 8.4.0, depending on the default value of escape is deprecated.
$line = fgetcsv($handle, null, ',', '"', '\\');
} else {
$line = fgetcsv($handle);
}
if (!is_array($line) || count($line) !=2) {
continue;
}
Expand Down

0 comments on commit 5b145f2

Please sign in to comment.