Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e75edf

Browse files
committed
bug #34903 Fixing bad order of operations with null coalescing operator (weaverryan)
This PR was merged into the 4.4 branch. Discussion ---------- Fixing bad order of operations with null coalescing operator | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | None | License | MIT | Doc PR | not needed Hi! Reported by a user on SymfonyCasts :). Apparently without the parentheses, the order of operations is incorrect: https://3v4l.org/UZ7GU Thanks! Commits ------- 6291264 Fixing bad order of operations with null coalescing operator
2 parents 6e44447 + 6291264 commit 5e75edf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Serializer/Normalizer/ProblemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(bool $debug = false, array $defaultContext = [])
4141
public function normalize($exception, $format = null, array $context = [])
4242
{
4343
$context += $this->defaultContext;
44-
$debug = $this->debug && $context['debug'] ?? true;
44+
$debug = $this->debug && ($context['debug'] ?? true);
4545

4646
$data = [
4747
'type' => $context['type'],

0 commit comments

Comments
 (0)