Skip to content

Commit

Permalink
Support nullable booleans in stringifier.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Nikolaev committed Jul 30, 2019
1 parent dc8b8e2 commit 774456b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@
- object namer: remove "Interface" suffix.

7.0.2: Add TemplateMailerInterface::sendEmail().

7.0.3: Support nullable booleans in stringifier.
6 changes: 5 additions & 1 deletion Strings/Stringifier/DoctrineStringifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ private function stringifyArray($value)
/**
* @param mixed $value Value to stringify
*
* @return string
* @return string|null
*/
private function stringifyBoolean($value)
{
if (null === $value) {
return null;
}

return $this->translator->trans(sprintf('boolean.%d', $value));
}

Expand Down

0 comments on commit 774456b

Please sign in to comment.