Skip to content

Commit

Permalink
Issue #2 - Fix dependency injection issue
Browse files Browse the repository at this point in the history
  • Loading branch information
srenon committed Mar 24, 2017
1 parent 26c4e8f commit a4a91a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 34 deletions.
33 changes: 1 addition & 32 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,6 @@
class Data extends \Magento\Framework\App\Helper\AbstractHelper
{

/**
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager;


/**
* Core store config
*
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
protected $_scopeConfig;


/**
* @param \Magento\Framework\App\Helper\Context $context
* @param \Magento\Framework\ObjectManagerInterface
*/

public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Magento\Framework\ObjectManagerInterface $objectManager,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
)
{
$this->_scopeConfig = $scopeConfig;
$this->_objectManager = $objectManager;
parent::__construct($context);
}


public function getShippingType(){
$arrayValues = [];
$configData = $this->getConfigData('shipping_type');
Expand Down Expand Up @@ -81,7 +50,7 @@ public function getConfigData($field)

$path = 'carriers/' . $code . '/' . $field;

return $this->_scopeConfig->getValue(
return $this->scopeConfig->getValue(
$path,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"magento/framework": "100.0.*|100.1.*"
},
"type": "magento2-module",
"version": "1.2.0",
"version": "1.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MagePal_CustomShippingRate" setup_version="1.0.0">
<module name="MagePal_CustomShippingRate" setup_version="1.2.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Shipping"/>
Expand Down

0 comments on commit a4a91a9

Please sign in to comment.