From 1558265448dbaa1bcd37e3cf606ba883ed68b26e Mon Sep 17 00:00:00 2001 From: Sonata CI Date: Wed, 3 Apr 2024 19:29:54 +0100 Subject: [PATCH] DevKit updates for 3.x branch (#667) Co-authored-by: Vincent Langlet --- .php-cs-fixer.dist.php | 2 +- src/Writer/CsvWriterTerminate.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index d197afd5..67707a5e 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -45,7 +45,7 @@ 'no_useless_return' => true, 'no_superfluous_elseif' => true, 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true, 'remove_inheritdoc' => true], - 'nullable_type_declaration_for_default_null_value' => ['use_nullable_type_declaration' => true], + 'nullable_type_declaration_for_default_null_value' => true, 'ordered_class_elements' => true, 'ordered_imports' => ['sort_algorithm' => 'alpha', 'imports_order' => ['class', 'function', 'const']], 'phpdoc_order' => ['order' => ['var', 'param', 'throws', 'return', 'phpstan-var', 'psalm-var', 'phpstan-param', 'psalm-param', 'phpstan-return', 'psalm-return']], diff --git a/src/Writer/CsvWriterTerminate.php b/src/Writer/CsvWriterTerminate.php index 6ad6265e..43c26fb0 100644 --- a/src/Writer/CsvWriterTerminate.php +++ b/src/Writer/CsvWriterTerminate.php @@ -21,16 +21,16 @@ final class CsvWriterTerminate extends \php_user_filter /** * @param resource $in * @param resource $out - * @param int $rw_consumed + * @param int $consumed * @param bool $closing */ - public function filter($in, $out, &$rw_consumed, $closing): int + public function filter($in, $out, &$consumed, $closing): int { while ($bucket = stream_bucket_make_writeable($in)) { if (isset($this->params['terminate'])) { $bucket->data = preg_replace('/([^\r])\n/', '$1'.$this->params['terminate'], $bucket->data); } - $rw_consumed += $bucket->datalen; + $consumed += (int) $bucket->datalen; stream_bucket_append($out, $bucket); }