From 1f7e664859a9ad32a0b2ff1c3d4449ec168702f0 Mon Sep 17 00:00:00 2001
From: Nicolas <nicolas@bejean.eu>
Date: Sun, 7 Oct 2018 15:35:51 +0200
Subject: [PATCH] Documentation : Documentation auto pour PHP Storm

---
 Block/Widget/CategoryWidget.php               | 28 +++++++++++++++++--
 Model/Config/Source/CategoryList.php          |  4 +--
 .../templates/widget/category_widget.phtml    |  6 ++++
 .../category_widget_img_background.phtml      | 10 +++++--
 4 files changed, 40 insertions(+), 8 deletions(-)

diff --git a/Block/Widget/CategoryWidget.php b/Block/Widget/CategoryWidget.php
index 00e76de..f4cfb0b 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 0d09826..be758b4 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 e101b02..a6c40ab 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 cf1360a..5c18dd0 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">
-- 
GitLab