Skip to content

Commit 7b7b83a

Browse files
committed
#24730: codereview fixes
simplify execute method
1 parent 4d0debd commit 7b7b83a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/code/Magento/Sales/Model/Order/Invoice/GetLogoFile.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,17 @@ public function __construct(
4848
*/
4949
public function execute(): ?string
5050
{
51-
$result = null;
52-
5351
$invoiceLogoPath = $this->getIdentityLogoHtml();
54-
if ($invoiceLogoPath) {
55-
$mediaBaseUrl = $this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]);
56-
$result = sprintf('%s%s%s', $mediaBaseUrl, $this->getLogoBaseDir(), $invoiceLogoPath);
52+
if (!$invoiceLogoPath) {
53+
return null;
5754
}
5855

59-
return $result;
56+
return sprintf(
57+
"%s%s%s",
58+
$this->urlBuilder->getBaseUrl(['_type' => UrlInterface::URL_TYPE_MEDIA]),
59+
$this->getLogoBaseDir(),
60+
$invoiceLogoPath
61+
);
6062
}
6163

6264
/**

0 commit comments

Comments
 (0)