Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMM-12 Remove unused variables from phtml files #357

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ use Snowdog\Menu\Block\NodeType\Product;
<?php
$nodeId = $block->getId();
$productUrl = $block->getProductUrl($nodeId);
$productPrice = $block->getProductPrice($nodeId);
$formattedProductPrice = $block->getFormattedProductPrice($nodeId);
$productImage = $block->getProductImage($nodeId);
$imageSize = '300';
$resizedProductImage = $block->getResizedProductImage($nodeId, $imageSize, $imageSize);
$productTitle = $block->getProductTitle($nodeId);
$productUrl = $productUrl ?: '#';
$title = $block->getTitle();
$imageUrl = $block->getImageUrl();
$imageAltText = $block->getImageAltText();
$nodeClasses = $block->getNodeClasses();
$imageWidth = $block->getImageWidth();
$imageHeight = $block->getImageHeight();
?>

<?php if ($resizedProductImage): ?>
Expand Down
2 changes: 0 additions & 2 deletions view/frontend/templates/hyva-menu-footer/menu/sub_menu.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ use Snowdog\Menu\Block\Menu;
?>
<?php if ($block->getMenu()): ?>
<?php
$menuClass = $block->getMenu()->getCssClass();
$parentNode = $block->getParentNode();
$level = $block->getLevel();
$title = $parentNode->getTitle();
?>
<ul class="space-y-2"
Expand Down
6 changes: 0 additions & 6 deletions view/frontend/templates/hyva-topmenu-desktop/menu.phtml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
<?php
use Hyva\Theme\Model\ViewModelRegistry;
use Hyva\Theme\ViewModel\HeroiconsSolid;
use Hyva\Theme\ViewModel\Navigation;
use Magento\Framework\View\Element\Template;
use Magento\Framework\Escaper;
use Snowdog\Menu\Block\Menu;

/** @var Menu $block */
/** @var Template $block */
/** @var Escaper $escaper */
/** @var ViewModelRegistry $viewModels */

/** @var Navigation $viewModelNavigation */
$viewModelNavigation = $viewModels->require(Navigation::class);

/** @var HeroiconsSolid $heroiconsSolid */
$heroiconsSolid = $viewModels->require(HeroiconsSolid::class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,12 @@ use Snowdog\Menu\Block\NodeType\Product;
<?php
$nodeId = $block->getId();
$productUrl = $block->getProductUrl($nodeId);
$productPrice = $block->getProductPrice($nodeId);
$formattedProductPrice = $block->getFormattedProductPrice($nodeId);
$productImage = $block->getProductImage($nodeId);
$imageSize = '300';
$resizedProductImage = $block->getResizedProductImage($nodeId, $imageSize, $imageSize);
$productTitle = $block->getProductTitle($nodeId);
$productUrl = $productUrl ?: '#';
$title = $block->getTitle();
$imageUrl = $block->getImageUrl();
$imageAltText = $block->getImageAltText();
$nodeClasses = $block->getNodeClasses();
$imageWidth = $block->getImageWidth();
$imageHeight = $block->getImageHeight();
?>

<?php if ($resizedProductImage): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

/** @var Escaper $escaper */
/** @var Menu $block */
/** @var HeroiconsOutline $heroicons */
/** @var ViewModelRegistry $viewModels */

use Hyva\Theme\Model\ViewModelRegistry;
use Hyva\Theme\ViewModel\HeroiconsOutline;
use Magento\Framework\Escaper;
use Snowdog\Menu\Block\Menu;

$heroicons = $viewModels->require(HeroiconsOutline::class);
?>
<?php if ($block->getMenu()): ?>
<?php
Expand Down Expand Up @@ -64,7 +59,7 @@ $heroicons = $viewModels->require(HeroiconsOutline::class);
?>
<li
class="
<?= /* @noEscape */ (string) $nodeType === 'wrapper' ? $escaper->escapeHtmlAttr($nodeClasses) : '' ?>"
<?= /* @noEscape */ (string) $nodeType === 'wrapper' ? $escaper->escapeHtmlAttr($nodeClasses) : '' ?>
<?= (/* @noEscape */ (string) $nodeType === 'wrapper') && (/* @noEscape */ (int) $level > 2) ? '-ml-4' : '' ?>
"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use Snowdog\Menu\Block\NodeType\Category;
<?php
$nodeId = $block->getId();
$categoryUrl = $block->getCategoryUrl($nodeId) ?: '#';
$imageUrl = $block->getImageUrl();
$imageAltText = $block->getImageAltText();
$nodeClasses = $block->getNodeClasses();

if ($block->getIsViewAllLink()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ use Snowdog\Menu\Block\NodeType\CustomUrl;
?>
<?php
$nodeId = $block->getId();
$imageUrl = $block->getImageUrl();
$imageAltText = $block->getImageAltText();
$content = $block->getContent();
$title = $block->getTitle();
$dataAttribute = 'data-menu="menu-' . $nodeId . '"';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,8 @@ use Snowdog\Menu\Block\NodeType\Product;
<?php
$nodeId = $block->getId();
$productUrl = $block->getProductUrl($nodeId);
$productPrice = $block->getProductPrice($nodeId);
$formattedProductPrice = $block->getFormattedProductPrice($nodeId);
$productImage = $block->getProductImage($nodeId);
$resizedProductImage = $block->getResizedProductImage($nodeId, '300', '300');
$productTitle = $block->getProductTitle($nodeId);
$productUrl = $productUrl ?: '#';
$title = $block->getTitle();
$imageUrl = $block->getImageUrl();
$imageAltText = $block->getImageAltText();
$nodeClasses = $block->getNodeClasses();
?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ $heroicons = $viewModels->require(HeroiconsOutline::class);
<?php
$parentNode = $block->getParentNode();
$parentNodeIndex = 'node' . $parentNode->getId();
$level = $block->getLevel();
$title = $parentNode->getTitle();
?>
<ul x-ref="submenu-<?= /* @noEscape */ (string) $parentNodeIndex ?>"
class="pb-2 pl-4""
class="pb-2 pl-4"
x-show="<?= /* @noEscape */ (string) $parentNodeIndex ?>"
x-collapse
:aria-hidden="<?= /* @noEscape */ (string) $parentNodeIndex ?> === false ? 'true' : 'false'"
Expand All @@ -40,7 +39,7 @@ $heroicons = $viewModels->require(HeroiconsOutline::class);
$nodeType = $node->getType();
$nodeClasses = $node->getClasses();
?>
<li class="<?= /* @noEscape */ (string) $nodeType === 'wrapper' ? $escaper->escapeHtmlAttr($nodeClasses) : '' ?>""
<li class="<?= /* @noEscape */ (string) $nodeType === 'wrapper' ? $escaper->escapeHtmlAttr($nodeClasses) : '' ?>"
x-data="{ '<?= /* @noEscape */ (string) $indexId ?>': false }"
>
<?php if ($node->getIsParent() && !$node->getIsViewAllLink()): ?>
Expand Down
5 changes: 0 additions & 5 deletions view/frontend/templates/menu/node_type/product.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ use Snowdog\Menu\Block\NodeType\Product;
$nodeId = $block->getId();
$class = $block->getMenuClass();
$productUrl = $block->getProductUrl($nodeId);
$productPrice = $block->getProductPrice($nodeId);
$formattedProductPrice = $block->getFormattedProductPrice($nodeId);
$productImage = $block->getProductImage($nodeId);
$resizedProductImage = $block->getResizedProductImage($nodeId, '300', '300');
$productTitle = $block->getProductTitle($nodeId);
$productUrl = $productUrl ?: '#';
$dataAttribute = '';
$classLink = $block->getIsRoot() ? $class . '__link' : $class . '__inner-link';
Expand Down
Loading