8000 minor #47549 Add a few more ??= (nicolas-grekas) · symfony/symfony@e8826b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e8826b7

Browse files
minor #47549 Add a few more ??= (nicolas-grekas)
This PR was merged into the 6.2 branch. Discussion ---------- Add a few more ??= | Q | A | ------------- | --- | Branch? | 6.2 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Commits ------- 0a514a9 Add a few more ??=
2 parents ee78099 + 0a514a9 commit e8826b7

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ private function addInlineService(string $id, Definition $definition, Definition
10261026
}
10271027
}
10281028

1029-
if (isset($this->definitionVariables[$inlineDef = $inlineDef ?: $definition])) {
1029+
if (isset($this->definitionVariables[$inlineDef ??= $definition])) {
10301030
return $code;
10311031
}
10321032

src/Symfony/Component/ErrorHandler/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ public function handleException(\Throwable $exception)
539539
if (null !== $exceptionHandler) {
540540
return $exceptionHandler($exception);
541541
}
542-
$handlerException = $handlerException ?: $exception;
542+
$handlerException ??= $exception;
543543
} catch (\Throwable $handlerException) {
544544
}
545545
if ($exception === $handlerException && null === $this->exceptionHandler) {

src/Symfony/Component/Form/Tests/Extension/Core/EventListener/MergeCollectionListenerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract protected function getBuilder($name = 'name');
3434

3535
protected function getForm($name = 'name', $propertyPath = null)
3636
{
37-
$propertyPath = $propertyPath ?: $name;
37+
$propertyPath ??= $name;
3838

3939
return $this->getBuilder($name)->setAttribute('property_path', $propertyPath)->getForm();
4040
}

src/Symfony/Component/HttpKernel/HttpKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function terminate(Request $request, Response $response)
105105
*/
106106
public function terminateWithException(\Throwable $exception, Request $request = null)
107107
{
108-
if (!$request = $request ?: $this->requestStack->getMainRequest()) {
108+
if (!$request ??= $this->requestStack->getMainRequest()) {
109109
throw $exception;
110110
}
111111

src/Symfony/Component/Notifier/Channel/EmailChannel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function notify(Notification $notification, RecipientInterface $recipient
5353
$message = $notification->asEmailMessage($recipient, $transportName);
5454
}
5555

56-
$message = $message ?: EmailMessage::fromNotification($notification, $recipient, $transportName);
56+
$message ??= EmailMessage::fromNotification($notification, $recipient, $transportName);
5757
$email = $message->getMessage();
5858
if ($email instanceof Email) {
5959
if (!$email->getFrom()) {

0 commit comments

Comments
 (0)
0