Skip to content

Commit 1d1a92e

Browse files
committed
minor #17799 [DependencyInjection] Update tags.rst (hbgamra)
This PR was submitted for the 6.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- [DependencyInjection] Update tags.rst Optimize getTransport() function <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- a2df575 Update tags.rst
2 parents 59b62f0 + a2df575 commit 1d1a92e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

service_container/tags.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,7 @@ To begin with, change the ``TransportChain`` class::
405405

406406
public function getTransport($alias): ?\MailerTransport
407407
{
408-
if (array_key_exists($alias, $this->transports)) {
409-
return $this->transports[$alias];
410-
}
411-
412-
return null;
408+
return return $this->transports[$alias] ?? null;
413409
}
414410
}
415411

0 commit comments

Comments
 (0)