Skip to content

Commit

Permalink
Fixes and cleanup of a bunch of things phpstan discovered on level 0
Browse files Browse the repository at this point in the history
  • Loading branch information
baldwinagency-pieter committed Jul 18, 2023
1 parent 0aa3c09 commit fc1be59
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Batch/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {

$this->resultPageFactory = $resultPageFactory;
return parent::__construct($context);

parent::__construct($context);
}
public function execute()
{
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Cron/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {

$this->resultPageFactory = $resultPageFactory;
return parent::__construct($context);

parent::__construct($context);
}
public function execute()
{
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Errors/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
) {

$this->resultPageFactory = $resultPageFactory;
return parent::__construct($context);

parent::__construct($context);
}
public function execute()
{
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Orders/Campaign.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public function execute()
$campaign = $api->campaigns->get($order->getMailchimpCampaignId());
$webId = $campaign['web_id'];
$url = $this->urlBuilder->getUrl('https://admin.mailchimp.com/reports/summary') . "?id=$webId";
$this->_redirect($url);
return $this->_redirect($url);
} catch(\Exception $e) {
$this->messageManager->addErrorMessage($e->getMessage());
$this->_redirect($this->urlBuilder->getUrl('sales/order'));
return $this->_redirect($this->urlBuilder->getUrl('sales/order'));
}
}
protected function _isAllowed()
Expand Down
4 changes: 2 additions & 2 deletions Controller/Adminhtml/Orders/Member.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public function execute()
$member = $api->lists->members->get($listId, hash('md5', strtolower($email)));
$memberId = $member['contact_id'];
$url = $this->urlBuilder->getUrl('https://admin.mailchimp.com/audience/contact-profile') . "?contact_id=$memberId";
$this->_redirect($url);
return $this->_redirect($url);
} catch(\Exception $e) {
$this->messageManager->addErrorMessage($e->getMessage());
$this->_redirect($this->urlBuilder->getUrl('sales/order'));
return $this->_redirect($this->urlBuilder->getUrl('sales/order'));
}
}
protected function _isAllowed()
Expand Down
3 changes: 2 additions & 1 deletion Controller/Checkout/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public function execute()
$this->_helper->log($e->getMessage());
}
$this->messageManager->addSuccessMessage(__('Thanks for sharing your interest with us'));
$this->_redirect($this->_helper->getBaserUrl(

return $this->_redirect($this->_helper->getBaserUrl(
$order->getStoreId(),
\Magento\Framework\UrlInterface::URL_TYPE_WEB
));
Expand Down
2 changes: 2 additions & 0 deletions Setup/Patch/Data/Migrate24.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public function apply()
$this->moduleDataSetup->getConnection()->query($query);

$this->moduleDataSetup->getConnection()->endSetup();

return $this;
}
public static function getDependencies()
{
Expand Down
2 changes: 2 additions & 0 deletions Setup/Patch/Data/Migrate32.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public function apply()
}
}
$this->moduleDataSetup->getConnection()->endSetup();

return $this;
}
public static function getDependencies()
{
Expand Down
6 changes: 4 additions & 2 deletions Setup/Patch/Data/Migrate35.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public function apply()
*/
foreach ($configCollection as $config) {
try {
$config->setValue($this->_helper->encrypt($config->getvalue()));
$config->setValue($this->helper->encrypt($config->getvalue()));
$config->getResource()->save($config);
} catch (\Exception $e) {
$this->_helper->log($e->getMessage());
$this->helper->log($e->getMessage());
}
}
$configCollection = $this->configFactory->create();
Expand All @@ -64,6 +64,8 @@ public function apply()
}

$this->moduleDataSetup->getConnection()->endSetup();

return $this;
}
public static function getDependencies()
{
Expand Down
2 changes: 2 additions & 0 deletions Setup/Patch/Data/Migrate452.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public function apply()
}

$this->moduleDataSetup->getConnection()->endSetup();

return $this;
}

public static function getDependencies()
Expand Down
4 changes: 2 additions & 2 deletions Ui/Component/Batch/Grid/Column/Batches.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(
array $components = [],
array $data = []
) {
$this->_helper = $helper;
$this->helper = $helper;
$this->mailChimpSyncB = $mailChimpSyncB;
$this->urlBuilder = $urlBuilder;
parent::__construct($context, $uiComponentFactory, $components, $data);
Expand Down Expand Up @@ -96,7 +96,7 @@ public function prepareDataSource(array $dataSource)
private function getMCStoreNameById($mailchimp_store_id, $magentoStoreId)
{
if (!key_exists($mailchimp_store_id, $this->stores)) {
$api = $this->_helper->getApi($magentoStoreId);
$api = $this->helper->getApi($magentoStoreId);
$store = $api->ecommerce->stores->get($mailchimp_store_id);
$this->stores[$mailchimp_store_id] = $store['name'];
}
Expand Down
8 changes: 0 additions & 8 deletions view/frontend/templates/loadquote.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,3 @@
// Add your template code here ...

?>








0 comments on commit fc1be59

Please sign in to comment.