Skip to content

Commit 97aabb1

Browse files
authored
Fix PHP 8.6 deprecation warnings (#41)
1 parent 0e67c88 commit 97aabb1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎Mail/mimePart.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ public function encode($boundary = null)
353353
for ($i = 0; $i < count($this->subparts); $i++) {
354354
$encoded['body'] .= '--' . $boundary . $eol;
355355
$tmp = $this->subparts[$i]->encode();
356-
if (is_a($tmp, 'PEAR_Error')) {
356+
if ($tmp instanceof PEAR_Error) {
357357
return $tmp;
358358
}
359359
foreach ($tmp['headers'] as $key => $value) {
@@ -375,7 +375,7 @@ public function encode($boundary = null)
375375
@ini_set('magic_quotes_runtime', $magic_quotes);
376376
}
377377

378-
if (is_a($body, 'PEAR_Error')) {
378+
if ($body instanceof PEAR_Error) {
379379
return $body;
380380
}
381381
$encoded['body'] = $body;
@@ -433,7 +433,7 @@ public function encodeToFile($filename, $boundary = null, $skip_head = false)
433433
@ini_set('magic_quotes_runtime', $magic_quotes);
434434
}
435435

436-
return is_a($res, 'PEAR_Error') ? $res : $this->headers;
436+
return $res instanceof PEAR_Error ? $res : $this->headers;
437437
}
438438

439439
/**
@@ -472,7 +472,7 @@ protected function encodePartToFile($fh, $boundary = null, $skip_head = false)
472472
for ($i = 0; $i < count($this->subparts); $i++) {
473473
fwrite($fh, $f_eol . '--' . $boundary . $eol);
474474
$res = $this->subparts[$i]->encodePartToFile($fh);
475-
if (is_a($res, 'PEAR_Error')) {
475+
if ($res instanceof PEAR_Error) {
476476
return $res;
477477
}
478478
$f_eol = $eol;
@@ -487,7 +487,7 @@ protected function encodePartToFile($fh, $boundary = null, $skip_head = false)
487487
$res = $this->getEncodedDataFromFile(
488488
$this->body_file, $this->encoding, $fh
489489
);
490-
if (is_a($res, 'PEAR_Error')) {
490+
if ($res instanceof PEAR_Error) {
491491
return $res;
492492
}
493493
}

0 commit comments

Comments
 (0)