Skip to content

Commit

Permalink
[Serializer] Remove null check
Browse files Browse the repository at this point in the history
  • Loading branch information
battye committed Jun 14, 2019
1 parent 805dd49 commit ae229e4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/Symfony/Component/Serializer/Encoder/CsvEncoder.php
Expand Up @@ -196,24 +196,18 @@ private function flatten(array $array, array &$result, $keySeparator, $parentKey

/**
* Ensures an actual value is used instead of a blank value when dealing
* with true, false and null (like a nullable bool in a database).
* with true and false.
*
* @param string $value
*
* @return string|int
* @return int
*/
private function cleanValueByType($value)
{
if (false === $value) {
return 0;
}

if (null === $value) {
// fputcsv will enclose a space
// https://github.com/php/php-src/blob/master/ext/standard/file.c
return ' ';
}

if (true === $value) {
return 1;
}
Expand Down

0 comments on commit ae229e4

Please sign in to comment.