Skip to content
This repository has been archived by the owner on Jul 25, 2023. It is now read-only.

Commit

Permalink
Various PSR coding standard improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
Erfan committed Feb 6, 2020
1 parent 68f7810 commit edb75f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
16 changes: 7 additions & 9 deletions src/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}

}
9 changes: 4 additions & 5 deletions src/Plugin/BlockPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 2 additions & 0 deletions src/etc/frontend/di.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<config>
<type name="Magento\Framework\View\Element\BlockFactory">
<plugin name="set_svg_helper" type="Meanbee\SVGHelper\Plugin\BlockPlugin" sortOrder="1" />
Expand Down
2 changes: 1 addition & 1 deletion src/registration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Meanbee_SVGHelper',
__DIR__
);
);

0 comments on commit edb75f8

Please sign in to comment.