8000 [Serializer] Remove null check · symfony/symfony@ae229e4 · GitHub
[go: up one dir, main page]

Skip to content

Commit ae229e4

Browse files
committed
[Serializer] Remove null check
1 parent 805dd49 commit ae229e4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Symfony/Component/Serializer/Encoder/CsvEncoder.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,24 +196,18 @@ private function flatten(array $array, array &$result, $keySeparator, $parentKey
196196

197197
/**
198198
* Ensures an actual value is used instead of a blank value when dealing
199-
* with true, false and null (like a nullable bool in a database).
199+
* with true and false.
200200
*
201201
* @param string $value
202202
*
203-
* @return string|int
203+
* @return int
204204
*/
205205
private function cleanValueByType($value)
206206
{
207207
if (false === $value) {
208208
return 0;
209209
}
210210

211-
if (null === $value) {
212-
// fputcsv will enclose a space
213-
// https://github.com/php/php-src/blob/master/ext/standard/file.c
214-
return ' ';
215-
}
216-
217211
if (true === $value) {
218212
return 1;
219213
}

0 commit comments

Comments
 (0)
0