Skip to content

Commit 036f99f

Browse files
krzkszihor-sviziev
andauthored
Apply suggestions from code review
Co-Authored-By: Ihor Sviziev <ihor-sviziev@users.noreply.github.com>
1 parent b54ce80 commit 036f99f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Theme/Controller/Result/JsFooterPlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ public function beforeSendResponse(Http $subject)
4848
);
4949

5050
if ($isEndBodyTagFound && $shouldMoveJsToBottom) {
51-
if ($scripts = $this->extractScriptTags($content)) {
51+
$scripts = $this->extractScriptTags($content)
52+
if ($scripts) {
5253
$content = str_replace($bodyEndTag, "$scripts\n$bodyEndTag", $content);
5354
$subject->setContent($content);
5455
}
@@ -60,7 +61,7 @@ public function beforeSendResponse(Http $subject)
6061
*
6162
* @param string $content
6263
*/
63-
public function extractScriptTags(&$content)
64+
private function extractScriptTags(&$content): string
6465
{
6566
$scripts = '';
6667
$scriptOpen = '<script';

0 commit comments

Comments
 (0)