Skip to content

Commit ff5d41a

Browse files
committed
fix(PHPStan): store result of mb_encoding_aliases() for PHPStan warn.
1 parent 0e5d3ae commit ff5d41a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Document.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private function getValidEncoding(?string $encoding): ?string
7171
} else {
7272
// PHP 8.0+: ValueError exception is thrown for invalid/empty encoding
7373
try {
74-
mb_encoding_aliases($encoding ?? '');
74+
$aliases = mb_encoding_aliases($encoding ?? '');
7575
// If mb_encoding_aliases succeeds, return the input value as is. Some encodings do not have aliases.
7676
return $encoding;
7777
} catch (\ValueError $exception) {

0 commit comments

Comments
 (0)