Skip to content

Commit 5bc1604

Browse files
javiereguiluzderrabus
authored andcommitted
Simplify some code with null coalesce operator
1 parent c8405e8 commit 5bc1604

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function __construct($grouping = false, $roundingMode = self::ROUND_DOWN,
3434
@trigger_error(sprintf('Passing a precision as the first value to %s::__construct() is deprecated since Symfony 4.2 and support for it will be dropped in 5.0.', __CLASS__), \E_USER_DEPRECATED);
3535

3636
$grouping = $roundingMode;
37-
$roundingMode = null !== $locale ? $locale : self::ROUND_DOWN;
37+
$roundingMode = $locale ?? self::ROUND_DOWN;
3838
$locale = null;
3939
}
4040

Extension/Core/Type/TextType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ public function transform($data)
6262
*/
6363
public function reverseTransform($data)
6464
{
65-
return null === $data ? '' : $data;
65+
return $data ?? '';
6666
}
6767
}

0 commit comments

Comments
 (0)