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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy