Skip to content

Commit

Permalink
revert "avoid returning useless null"
Browse files Browse the repository at this point in the history
this reverts commit f733111 due to symfony/symfony-docs#6614
  • Loading branch information
craue committed Jun 30, 2016
1 parent 8ff4029 commit 93acf16
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Twig/Extension/ChangeLanguageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function getName() {
*/
public function getLanguageName($locale, $forceLocaleForDisplay = null) {
if (empty($locale)) {
return;
return null;
}

$localeToUse = !empty($forceLocaleForDisplay) ? $forceLocaleForDisplay :
Expand Down
2 changes: 1 addition & 1 deletion Twig/Extension/FormatDateTimeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public function formatDateTime($value, $locale = null, $dateType = null, $timeTy
*/
protected function getFormattedDateTime($value, $locale, $dateType, $timeType, $timeZone = null) {
if ($value === null) {
return;
return null;
}

$valueToUse = $value;
Expand Down
4 changes: 2 additions & 2 deletions Twig/Extension/FormatNumberExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function formatSpelledOutNumber($value, $locale = null) {
*/
protected function getFormattedNumber($value, $locale, $style) {
if ($value === null) {
return;
return null;
}

$localeToUse = !empty($locale) ? $locale : $this->getLocale();
Expand All @@ -138,7 +138,7 @@ protected function getFormattedNumber($value, $locale, $style) {
*/
protected function getFormattedCurrency($value, $locale = null, $currency = null) {
if ($value === null) {
return;
return null;
}

$localeToUse = !empty($locale) ? $locale : $this->getLocale();
Expand Down

0 comments on commit 93acf16

Please sign in to comment.