Skip to content

Commit 148165c

Browse files
committed
Make New Function Static
1 parent b2befb4 commit 148165c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/PhpSpreadsheet/Reader/Html.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ public function loadIntoExisting(string $filename, Spreadsheet $spreadsheet): Sp
645645
// Reload the HTML file into the DOM object
646646
try {
647647
$convert = $this->getSecurityScannerOrThrow()->scanFile($filename);
648-
$convert = $this->replaceNonAsciiIfNeeded($convert);
648+
$convert = self::replaceNonAsciiIfNeeded($convert);
649649
$loaded = ($convert === null) ? false : $dom->loadHTML($convert);
650650
} catch (Throwable $e) {
651651
$loaded = false;
@@ -738,7 +738,7 @@ private static function replaceNonAscii(array $matches): string
738738
return '&#' . mb_ord($matches[0], 'UTF-8') . ';';
739739
}
740740

741-
private function replaceNonAsciiIfNeeded(string $convert): ?string
741+
private static function replaceNonAsciiIfNeeded(string $convert): ?string
742742
{
743743
if (preg_match(self::STARTS_WITH_BOM, $convert) !== 1 && preg_match(self::DECLARES_CHARSET, $convert) !== 1) {
744744
$lowend = "\u{80}";
@@ -763,7 +763,7 @@ public function loadFromString(string $content, ?Spreadsheet $spreadsheet = null
763763
// Reload the HTML file into the DOM object
764764
try {
765765
$convert = $this->getSecurityScannerOrThrow()->scan($content);
766-
$convert = $this->replaceNonAsciiIfNeeded($convert);
766+
$convert = self::replaceNonAsciiIfNeeded($convert);
767767
$loaded = ($convert === null) ? false : $dom->loadHTML($convert);
768768
} catch (Throwable $e) {
769769
$loaded = false;

0 commit comments

Comments
 (0)