Resolve #610 PHP 8.2

This commit is contained in:
the-djmaze 2022-11-02 09:21:04 +01:00
parent c199b63304
commit f805ae53dc

View file

@ -4,6 +4,8 @@ namespace MailSo\Base\StreamFilters;
class LineEndings extends \php_user_filter class LineEndings extends \php_user_filter
{ {
#[\ReturnTypeWillChange]
// public function filter($in, $out, &$consumed, bool $closing): int
public function filter($in, $out, &$consumed, $closing) public function filter($in, $out, &$consumed, $closing)
{ {
while ($bucket = \stream_bucket_make_writeable($in)) { while ($bucket = \stream_bucket_make_writeable($in)) {
@ -25,10 +27,13 @@ class LineEndings extends \php_user_filter
return PSFS_PASS_ON; return PSFS_PASS_ON;
} }
// public onClose(): void
// public onCreate(): bool
public static function appendTo($fp) public static function appendTo($fp)
{ {
\stream_filter_append($fp, 'crlf', STREAM_FILTER_ALL); \stream_filter_append($fp, 'crlf', STREAM_FILTER_ALL);
} }
} }
\stream_filter_register('crlf', 'MailSo\\Base\\StreamFilters\\LineEndings'); \stream_filter_register('crlf', LineEndings::class);