From 68f78105dcab6ce023d0a7f38a5c523553fdaf68 Mon Sep 17 00:00:00 2001 From: Erfan Date: Thu, 6 Feb 2020 11:48:54 +0800 Subject: [PATCH 1/2] Added Magento 2.3 compatibility. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b193548..2decf24 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ } }, "require": { - "magento/framework": "^101.0.0", + "magento/framework": "101 - 102", "psr/log": "~1.0" }, "authors": [ From edb75f8e6a374d0fe3d10965aa6ab615337f7af1 Mon Sep 17 00:00:00 2001 From: Erfan Date: Thu, 6 Feb 2020 12:00:09 +0800 Subject: [PATCH 2/2] Various PSR coding standard improvements. --- src/Helper/Data.php | 16 +++++++--------- src/Plugin/BlockPlugin.php | 9 ++++----- src/etc/frontend/di.xml | 2 ++ src/registration.php | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Helper/Data.php b/src/Helper/Data.php index 1eb8181..edf3000 100644 --- a/src/Helper/Data.php +++ b/src/Helper/Data.php @@ -6,17 +6,16 @@ class Data extends AbstractHelper { - protected $_assetSource; - protected $_assetRepository; + protected $assetSource; + protected $assetRepository; public function __construct( \Magento\Framework\App\Helper\Context $context, \Magento\Framework\View\Asset\Source $assetSource, \Magento\Framework\View\Asset\Repository $assetRepository - ) - { - $this->_assetSource = $assetSource; - $this->_assetRepository = $assetRepository; + ) { + $this->assetSource = $assetSource; + $this->assetRepository = $assetRepository; parent::__construct($context); } @@ -28,8 +27,7 @@ public function __construct( */ public function getViewSvg($path) { - $file = $this->_assetRepository->createAsset($path); - return $this->_assetSource->getContent($file); + $file = $this->assetRepository->createAsset($path); + return $this->assetSource->getContent($file); } - } diff --git a/src/Plugin/BlockPlugin.php b/src/Plugin/BlockPlugin.php index 6a18f34..8f13f5a 100644 --- a/src/Plugin/BlockPlugin.php +++ b/src/Plugin/BlockPlugin.php @@ -4,17 +4,16 @@ class BlockPlugin { - protected $_svgHelper; + protected $svgHelper; public function __construct( \Meanbee\SVGHelper\Helper\Data $svgHelper - ) - { - $this->_svgHelper = $svgHelper; + ) { + $this->svgHelper = $svgHelper; } public function afterCreateBlock($subject, $result) { - return $result->setData('svgHelper', $this->_svgHelper); + return $result->setData('svgHelper', $this->svgHelper); } } diff --git a/src/etc/frontend/di.xml b/src/etc/frontend/di.xml index 57661a1..0ddced2 100644 --- a/src/etc/frontend/di.xml +++ b/src/etc/frontend/di.xml @@ -1,3 +1,5 @@ + + diff --git a/src/registration.php b/src/registration.php index 7a58064..12d1dd1 100644 --- a/src/registration.php +++ b/src/registration.php @@ -4,4 +4,4 @@ \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Meanbee_SVGHelper', __DIR__ -); \ No newline at end of file +);