Skip to content

Commit

Permalink
phpcbf
Browse files Browse the repository at this point in the history
fix for compilation
  • Loading branch information
gonzaloebiz committed Jul 12, 2017
1 parent 9f55025 commit 7dc397b
Show file tree
Hide file tree
Showing 79 changed files with 608 additions and 660 deletions.
6 changes: 3 additions & 3 deletions Block/Adminhtml/Stores/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function __construct(
Context $context,
Registry $registry,
array $data = []
)
{
) {

$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
Expand Down Expand Up @@ -81,4 +81,4 @@ public function getHeaderText()
return __('Add Store');
}
}
}
}
2 changes: 1 addition & 1 deletion Block/Adminhtml/Stores/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ protected function _prepareForm()

return parent::_prepareForm();
}
}
}
10 changes: 4 additions & 6 deletions Block/Adminhtml/Stores/Edit/Tab/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public function __construct(
\Magento\Framework\Data\FormFactory $formFactory,
\Magento\Directory\Model\Config\Source\Country $country,
array $data = []
)
{
) {

$this->_country = $country;
parent::__construct($context, $registry, $formFactory, $data);
}
Expand Down Expand Up @@ -101,7 +101,7 @@ protected function _prepareForm()
);
$country = $this->_country->toOptionArray();
$countryArray = [''=> __('Select one')];
foreach($country as $c) {
foreach ($country as $c) {
$countryArray[$c['value']] = $c['label'];
}
$fieldset->addField(
Expand All @@ -121,7 +121,6 @@ protected function _prepareForm()
$this->setForm($form);

return parent::_prepareForm();

}
public function getTabLabel()
{
Expand All @@ -139,5 +138,4 @@ public function isHidden()
{
return false;
}

}
}
16 changes: 6 additions & 10 deletions Block/Adminhtml/Stores/Edit/Tab/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public function __construct(
\Magento\Config\Model\Config\Source\Locale $locale,
\Ebizmarts\MailChimp\Model\Config\Source\ApiKey $apiKey,
array $data = []
)
{
) {

$this->_timezone = $timezone;
$this->_yesno = $yesno;
$this->_currency = $currency;
Expand Down Expand Up @@ -105,8 +105,7 @@ protected function _prepareForm()
} else {
$apikey = $this->_apikey->toOptionArray();
$apikeyArray = [];
foreach($apikey as $a)
{
foreach ($apikey as $a) {
$apikeyArray[$a['value']] = $a['label'];
}
$url = $this->_urlBuilder->getUrl('mailchimp/stores/getList');
Expand All @@ -131,8 +130,6 @@ protected function _prepareForm()
'options' => $listArray,
]
);


}

$fieldset->addField(
Expand Down Expand Up @@ -177,8 +174,7 @@ protected function _prepareForm()
);
$currency = $this->_currency->toOptionArray();
$currencyArray = [''=> __('Select one')];
foreach($currency as $c)
{
foreach ($currency as $c) {
$currencyArray[$c['value']] = $c['label'];
}
$fieldset->addField(
Expand All @@ -193,7 +189,7 @@ protected function _prepareForm()
);
$locale = $this->_locale->toOptionArray();
$localeArray = [''=> __('Select one')];
foreach($locale as $l) {
foreach ($locale as $l) {
$localeArray[$l['value']] = $l['label'];
}

Expand All @@ -209,7 +205,7 @@ protected function _prepareForm()
);
$timezone = $this->_timezone->toOptionArray();
$timezoneArray = [''=> __('Select one')];
foreach($timezone as $t) {
foreach ($timezone as $t) {
$timezoneArray[$t['value']] = $t['label'];
}
$fieldset->addField(
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/Stores/Edit/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ protected function _beforeToHtml()

return parent::_beforeToHtml();
}
}
}
3 changes: 1 addition & 2 deletions Block/Adminhtml/System/Config/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ protected function _getElementHtml(\Magento\Framework\Data\Form\Element\Abstract
foreach ($values as $dat) {
if ($dat['value']!=='') {
$html .= "<li>{$dat['label']}: {$dat['value']}</li>";
}
else {
} else {
$html .= "<li>{$dat['label']}</li>";
}
}
Expand Down
2 changes: 1 addition & 1 deletion Block/Adminhtml/System/Config/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $ele
$element->setTimeFormat(null);
return parent::render($element);
}
}
}
20 changes: 10 additions & 10 deletions Block/Adminhtml/System/Config/DeleteStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class DeleteStore extends \Magento\Config\Block\System\Config\Form\Field
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Ebizmarts\MailChimp\Helper\Data $helper,
array $data=[])
{
array $data = []
) {

$this->_helper = $helper;
parent::__construct($context, $data);
}
Expand Down Expand Up @@ -74,13 +75,12 @@ public function getButtonHtml(\Magento\Framework\Data\Form\Element\AbstractEleme
public function getAjaxCheckUrl()
{
$params = $this->getRequest()->getParams();
$scope = array();
if(isset($params['website'])) {
$scope = array('website'=>$params['website']);
}
elseif(isset($params['store'])) {
$scope = array('store'=>$params['store']);
$scope = [];
if (isset($params['website'])) {
$scope = ['website'=>$params['website']];
} elseif (isset($params['store'])) {
$scope = ['store'=>$params['store']];
}
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/DeleteStore',$scope);
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/DeleteStore', $scope);
}
}
}
20 changes: 10 additions & 10 deletions Block/Adminhtml/System/Config/ResetErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class ResetErrors extends \Magento\Config\Block\System\Config\Form\Field
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Ebizmarts\MailChimp\Helper\Data $helper,
array $data=[])
{
array $data = []
) {

$this->_helper = $helper;
parent::__construct($context, $data);
}
Expand Down Expand Up @@ -74,13 +75,12 @@ public function getButtonHtml(\Magento\Framework\Data\Form\Element\AbstractEleme
public function getAjaxCheckUrl()
{
$params = $this->getRequest()->getParams();
$scope = array();
if(isset($params['website'])) {
$scope = array('website'=>$params['website']);
}
elseif(isset($params['store'])) {
$scope = array('store'=>$params['store']);
$scope = [];
if (isset($params['website'])) {
$scope = ['website'=>$params['website']];
} elseif (isset($params['store'])) {
$scope = ['store'=>$params['store']];
}
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/ResetLocalErrors',$scope);
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/ResetLocalErrors', $scope);
}
}
}
20 changes: 10 additions & 10 deletions Block/Adminhtml/System/Config/ResetStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class ResetStore extends \Magento\Config\Block\System\Config\Form\Field
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Ebizmarts\MailChimp\Helper\Data $helper,
array $data=[])
{
array $data = []
) {

$this->_helper = $helper;
parent::__construct($context, $data);
}
Expand Down Expand Up @@ -74,13 +75,12 @@ public function getButtonHtml(\Magento\Framework\Data\Form\Element\AbstractEleme
public function getAjaxCheckUrl()
{
$params = $this->getRequest()->getParams();
$scope = array();
if(isset($params['website'])) {
$scope = array('website'=>$params['website']);
}
elseif(isset($params['store'])) {
$scope = array('store'=>$params['store']);
$scope = [];
if (isset($params['website'])) {
$scope = ['website'=>$params['website']];
} elseif (isset($params['store'])) {
$scope = ['store'=>$params['store']];
}
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/ResetStore',$scope);
return $this->_urlBuilder->getUrl('mailchimp/ecommerce/ResetStore', $scope);
}
}
}
2 changes: 1 addition & 1 deletion Block/Catcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ class Catcher extends Template
protected $_template = "catcher.phtml";

// write your methods here...
}
}
2 changes: 1 addition & 1 deletion Block/Loadquote.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ class Loadquote extends Template
protected $_template = "loadquote.phtml";

// write your methods here...
}
}
11 changes: 4 additions & 7 deletions Block/Mailchimpjs.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Ebizmarts\MailChimp\Block;


class Mailchimpjs extends \Magento\Framework\View\Element\Template
{
/**
Expand All @@ -29,24 +28,22 @@ class Mailchimpjs extends \Magento\Framework\View\Element\Template
* Mailchimpjs constructor.
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Ebizmarts\MailChimp\Helper\Data $helper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Ebizmarts\MailChimp\Helper\Data $helper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data
)
{
) {

parent::__construct($context, $data);
$this->_helper = $helper;
$this->_storeManager = $storeManager;
$this->_storeManager = $context->getStoreManager();
}

public function getJsUrl()
{
$storeId = $this->_storeManager->getStore()->getId();
return $this->_helper->getJsUrl($storeId);
}
}
}
8 changes: 4 additions & 4 deletions Controller/Adminhtml/Ecommerce/DeleteStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
\Ebizmarts\MailChimp\Helper\Data $helper,
\Magento\Config\Model\ResourceModel\Config $config
)
{
) {

parent::__construct($context);
$this->resultJsonFactory = $resultJsonFactory;
$this->helper = $helper;
Expand Down Expand Up @@ -85,7 +85,7 @@ public function execute()
try {
$this->helper->deleteStore($mailchimpStore);
$this->_config->deleteConfig(\Ebizmarts\MailChimp\Helper\Data::XML_MAILCHIMP_STORE, $scope, $storeId);
} catch(ValidatorException $e) {
} catch (ValidatorException $e) {
$valid = 0;
$message = $e->getMessage();
}
Expand All @@ -98,4 +98,4 @@ protected function _isAllowed()
{
return $this->_authorization->isAllowed('Ebizmarts_MailChimp::config_mailchimp');
}
}
}
12 changes: 5 additions & 7 deletions Controller/Adminhtml/Ecommerce/Getaccountdetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,15 @@ class Getaccountdetails extends Action
/**
* GetAccountDetails constructor.
* @param Context $context
* @param ResultFactory $resultFactory
* @param \Ebizmarts\MailChimp\Helper\Data $helper
*/
public function __construct(
Context $context,
ResultFactory $resultFactory,
\Ebizmarts\MailChimp\Helper\Data $helper
)
{
) {

parent::__construct($context);
$this->_resultFactory = $resultFactory;
$this->_resultFactory = $context->getResultFactory();
$this->_helper = $helper;
}
public function execute()
Expand Down Expand Up @@ -75,7 +73,7 @@ public function execute()
$options['nostore'] = ['label' => __('This MailChimp account is not connected to Magento.'), 'value' => ''];
}
}
} catch(\Mailchimp_Error $e) {
} catch (\Mailchimp_Error $e) {
$options['error'] = ['label' => 'Error', 'value' => __('--- Invalid API Key ---')];
}

Expand All @@ -88,4 +86,4 @@ protected function _isAllowed()
{
return $this->_authorization->isAllowed('Ebizmarts_MailChimp::config_mailchimp');
}
}
}
8 changes: 4 additions & 4 deletions Controller/Adminhtml/Ecommerce/ResetLocalErrors.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function __construct(
JsonFactory $resultJsonFactory,
\Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
\Ebizmarts\MailChimp\Helper\Data $helper
)
{
) {

parent::__construct($context);
$this->resultJsonFactory = $resultJsonFactory;
$this->helper = $helper;
Expand Down Expand Up @@ -80,7 +80,7 @@ public function execute()
$resultJson = $this->resultJsonFactory->create();
try {
$this->helper->resetErrors($mailchimpStore);
} catch(ValidatorException $e) {
} catch (ValidatorException $e) {
$valid = 0;
$message = $e->getMessage();
}
Expand All @@ -93,4 +93,4 @@ protected function _isAllowed()
{
return $this->_authorization->isAllowed('Ebizmarts_MailChimp::config_mailchimp');
}
}
}
Loading

0 comments on commit 7dc397b

Please sign in to comment.