diff --git a/Block/Widget/CategoryWidget.php b/Block/Widget/CategoryWidget.php index 00e76de29a1486017634ff2c2368daf7dfa3ea33..f4cfb0bfaa7e58a73d26746e28f54a9d15ef0863 100755 --- a/Block/Widget/CategoryWidget.php +++ b/Block/Widget/CategoryWidget.php @@ -4,12 +4,31 @@ namespace NicolasBejean\CategoryWidget\Block\Widget; class CategoryWidget extends \Magento\Framework\View\Element\Template implements \Magento\Widget\Block\BlockInterface { /** - * Default value for products count that will be shown + * Category helper + * + * @var \Magento\Catalog\Helper\Category */ protected $_categoryHelper; + + /** + * Category Flat Config + * + * @var \Magento\Catalog\Model\Indexer\Category\Flat\State + */ protected $categoryFlatConfig; + /** + * Top Menu + * + * @var \Magento\Theme\Block\Html\Topmenu + */ protected $topMenu; + + /** + * Category factory + * + * @var \Magento\Catalog\Model\CategoryFactory + */ protected $_categoryFactory; protected $widgetTitle; @@ -18,7 +37,9 @@ class CategoryWidget extends \Magento\Framework\View\Element\Template implements /** * @param \Magento\Framework\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Category $categoryHelper - * @param array $data + * @param \Magento\Catalog\Model\Indexer\Category\Flat\State $categoryFlatState + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Theme\Block\Html\Topmenu $topMenu */ public function __construct( \Magento\Framework\View\Element\Template\Context $context, @@ -29,10 +50,11 @@ class CategoryWidget extends \Magento\Framework\View\Element\Template implements ) { $this->_categoryHelper = $categoryHelper; $this->categoryFlatConfig = $categoryFlatState; - $this->topMenu = $topMenu; $this->_categoryFactory = $categoryFactory; + $this->topMenu = $topMenu; parent::__construct($context); } + /** * Return categories helper */ diff --git a/Model/Config/Source/CategoryList.php b/Model/Config/Source/CategoryList.php index 0d098268200e5e07b7fa0583f093ced8bca08030..be758b4cc4f9a87a2a655778138d1799db0ae80f 100755 --- a/Model/Config/Source/CategoryList.php +++ b/Model/Config/Source/CategoryList.php @@ -2,7 +2,6 @@ namespace NicolasBejean\CategoryWidget\Model\Config\Source; use Magento\Framework\Option\ArrayInterface; -use Magento\Catalog\Helper\Category; class CategoryList implements ArrayInterface { @@ -66,5 +65,4 @@ class CategoryList implements ArrayInterface return $categoryList; } -} -?> \ No newline at end of file +} \ No newline at end of file diff --git a/view/frontend/templates/widget/category_widget.phtml b/view/frontend/templates/widget/category_widget.phtml index e101b029f536ef43f725fe2b61b1e52ca1457515..a6c40ab2896df3be6e08cdd0ffd7e14cdb2e2e46 100755 --- a/view/frontend/templates/widget/category_widget.phtml +++ b/view/frontend/templates/widget/category_widget.phtml @@ -1,4 +1,10 @@ <?php +// @codingStandardsIgnoreFile +?> +<?php +/** + * @var $this \NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget + */ $categories = $this->getCategorySelection(); $categoryHelper = $this->getCategoryHelper(); ?> diff --git a/view/frontend/templates/widget/category_widget_img_background.phtml b/view/frontend/templates/widget/category_widget_img_background.phtml index cf1360a49d2368bb1c905ec61934f378aaabab30..5c18dd0bdf94a862d632ccfa80d5d0bbcb36050c 100755 --- a/view/frontend/templates/widget/category_widget_img_background.phtml +++ b/view/frontend/templates/widget/category_widget_img_background.phtml @@ -1,6 +1,12 @@ <?php - $categories = $this->getCategorySelection(); - $categoryHelper = $this->getCategoryHelper(); +// @codingStandardsIgnoreFile +?> +<?php +/** + * @var $this \NicolasBejean\CategoryWidget\Block\Widget\CategoryWidget + */ +$categories = $this->getCategorySelection(); +$categoryHelper = $this->getCategoryHelper(); ?> <div class="widget block block-static-block category-widget"> <div class="block-content">