diff --git a/Block/SubcategoriesList.php b/Block/SubcategoriesList.php index b6a308c..d47174b 100644 --- a/Block/SubcategoriesList.php +++ b/Block/SubcategoriesList.php @@ -30,12 +30,7 @@ class SubcategoriesList extends \Magento\Framework\View\Element\Template impleme * @var CategoryRepositoryInterface */ protected $categoryRepository; - /** - * Store manager - * - * @var \Magento\Store\Model\StoreManagerInterface - */ - protected $storeManager; + /** * Catalog layer * @@ -53,7 +48,6 @@ class SubcategoriesList extends \Magento\Framework\View\Element\Template impleme * @param \Swissup\Easycatalogimg\Helper\Config $configHelper * @param \Magento\Framework\Registry $registry * @param CategoryRepositoryInterface $categoryRepository - * @param \Magento\Store\Model\StoreManagerInterface $storeManager * @param \Swissup\Easycatalogimg\Helper\Image $imageHelper * @param \Magento\Catalog\Model\Layer\Resolver $layerResolver * @param \Magento\Framework\File\Mime $mime @@ -64,7 +58,6 @@ public function __construct( \Swissup\Easycatalogimg\Helper\Config $configHelper, \Magento\Framework\Registry $registry, CategoryRepositoryInterface $categoryRepository, - \Magento\Store\Model\StoreManagerInterface $storeManager, \Swissup\Easycatalogimg\Helper\Image $imageHelper, \Magento\Catalog\Model\Layer\Resolver $layerResolver, \Magento\Framework\File\Mime $mime, @@ -73,7 +66,6 @@ public function __construct( $this->configHelper = $configHelper; $this->coreRegistry = $registry; $this->categoryRepository = $categoryRepository; - $this->storeManager = $storeManager; $this->imageHelper = $imageHelper; $this->catalogLayer = $layerResolver->get(); $this->mime = $mime; @@ -217,7 +209,7 @@ public function getCategoryId() */ public function getCurrentStore() { - return $this->storeManager->getStore(); + return $this->_storeManager->getStore(); } /** * Get category thumbnail, image or placeholder url diff --git a/Helper/Config.php b/Helper/Config.php index 9d277ea..d91b736 100644 --- a/Helper/Config.php +++ b/Helper/Config.php @@ -92,28 +92,10 @@ class Config extends AbstractHelper * @var string */ const XML_PATH_CATEGORY_CONFIG = 'easycatalogimg/category'; - /** - * @var \Magento\Framework\App\Config\ScopeConfigInterface - */ - protected $_scopeConfig; - /** - * Constructor - * - * @param \Magento\Framework\App\Helper\Context $context - * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - \Magento\Framework\App\Helper\Context $context, - \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig - ) - { - parent::__construct($context); - $this->_scopeConfig = $scopeConfig; - } + protected function _getConfig($key) { - return $this->_scopeConfig->getValue($key, ScopeInterface::SCOPE_STORE); + return $this->scopeConfig->getValue($key, ScopeInterface::SCOPE_STORE); } public function useImageAttribute() { diff --git a/Helper/Image.php b/Helper/Image.php index dafa1d8..498debb 100644 --- a/Helper/Image.php +++ b/Helper/Image.php @@ -39,33 +39,25 @@ class Image extends \Magento\Framework\App\Helper\AbstractHelper * @var \Magento\Framework\Filesystem */ protected $fileSystem; - /** - * url builder - * - * @var \Magento\Framework\UrlInterface - */ - protected $urlBuilder; + /** * @param \Magento\Framework\App\Helper\Context $context * @param \Magento\Framework\Filesystem\Io\File $ioFile * @param \Magento\Framework\Image\Factory $imageFactory * @param \Swissup\Easycatalogimg\Helper\Config $configHelper * @param \Magento\Framework\Filesystem $fileSystem - * @param \Magento\Framework\UrlInterface $urlBuilder */ public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Framework\Filesystem\Io\File $ioFile, \Magento\Framework\Image\Factory $imageFactory, \Swissup\Easycatalogimg\Helper\Config $configHelper, - \Magento\Framework\Filesystem $fileSystem, - UrlInterface $urlBuilder + \Magento\Framework\Filesystem $fileSystem ) { $this->ioFile = $ioFile; $this->imageFactory = $imageFactory; $this->configHelper = $configHelper; $this->fileSystem = $fileSystem; - $this->urlBuilder = $urlBuilder; parent::__construct($context); } /** @@ -149,7 +141,7 @@ public function getBaseUrl( $type = UrlInterface::URL_TYPE_MEDIA ) { - return $this->urlBuilder + return $this->_urlBuilder ->getBaseUrl(['_type' => $type]) . $path; } /**