Skip to content

Commit 6409dbe

Browse files
author
v.sikailo
committed
partial fixes in Newsletter module
- PHPDocs - strict_type
1 parent 4f23251 commit 6409dbe

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

app/code/Magento/Newsletter/Block/Adminhtml/Problem.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function _prepareLayout()
8383
/**
8484
* Get the html element for unsubscribe button
8585
*
86-
* @return $string
86+
* @return string
8787
*/
8888
public function getUnsubscribeButtonHtml()
8989
{
@@ -93,7 +93,7 @@ public function getUnsubscribeButtonHtml()
9393
/**
9494
* Get the html element for delete button
9595
*
96-
* @return $string
96+
* @return string
9797
*/
9898
public function getDeleteButtonHtml()
9999
{

app/code/Magento/Newsletter/Controller/Adminhtml/Subscriber/MassDelete.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ class MassDelete extends Subscriber
1818
* @var SubscriberFactory
1919
*/
2020
private $subscriberFactory;
21-
21+
2222
/**
2323
* @param Context $context
2424
* @param FileFactory $fileFactory
25+
* @param SubscriberFactory|null $subscriberFactory
2526
*/
2627
public function __construct(
2728
Context $context,

app/code/Magento/Newsletter/Controller/Manage/Save.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\Newsletter\Controller\Manage;
89

@@ -65,9 +66,9 @@ public function __construct(
6566
/**
6667
* Save newsletter subscription preference action
6768
*
68-
* @return void|null
69+
* @return \Magento\Framework\App\ResponseInterface
6970
*/
70-
public function execute()
71+
public function execute(): \Magento\Framework\App\ResponseInterface
7172
{
7273
if (!$this->formKeyValidator->validate($this->getRequest())) {
7374
return $this->_redirect('customer/account/');
@@ -110,7 +111,7 @@ public function execute()
110111
$this->messageManager->addError(__('Something went wrong while saving your subscription.'));
111112
}
112113
}
113-
$this->_redirect('customer/account/');
114+
return $this->_redirect('customer/account/');
114115
}
115116

116117
/**
@@ -119,7 +120,7 @@ public function execute()
119120
* @param Customer $customer
120121
* @return void
121122
*/
122-
private function setIgnoreValidationFlag($customer)
123+
private function setIgnoreValidationFlag(Customer $customer): void
123124
{
124125
$customer->setData('ignore_validation_flag', true);
125126
}

app/code/Magento/Newsletter/Controller/Subscriber/Confirm.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@
44
* Copyright © Magento, Inc. All rights reserved.
55
* See COPYING.txt for license details.
66
*/
7+
declare(strict_types=1);
8+
79
namespace Magento\Newsletter\Controller\Subscriber;
810

911
class Confirm extends \Magento\Newsletter\Controller\Subscriber
1012
{
1113
/**
1214
* Subscription confirm action
13-
* @return void
15+
* @return \Magento\Framework\Controller\Result\Redirect
1416
*/
15-
public function execute()
17+
public function execute(): \Magento\Framework\Controller\Result\Redirect
1618
{
1719
$id = (int)$this->getRequest()->getParam('id');
1820
$code = (string)$this->getRequest()->getParam('code');

app/code/Magento/Newsletter/Model/Subscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ public function confirm($code)
686686
* Mark receiving subscriber of queue newsletter
687687
*
688688
* @param \Magento\Newsletter\Model\Queue $queue
689-
* @return boolean
689+
* @return Subscriber
690690
*/
691691
public function received(\Magento\Newsletter\Model\Queue $queue)
692692
{

0 commit comments

Comments
 (0)