File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
app/code/Magento/Newsletter/Controller/Subscriber Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- *
4
3
* Copyright © Magento, Inc. All rights reserved.
5
4
* See COPYING.txt for license details.
6
5
*/
7
6
namespace Magento \Newsletter \Controller \Subscriber ;
8
7
9
- class Unsubscribe extends \Magento \Newsletter \Controller \Subscriber
8
+ use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
9
+
10
+ /**
11
+ * Controller for unsubscribing customers.
12
+ */
13
+ class Unsubscribe extends \Magento \Newsletter \Controller \Subscriber implements HttpGetActionInterface
10
14
{
11
15
/**
12
- * Unsubscribe newsletter
13
- * @return void
16
+ * Unsubscribe newsletter.
17
+ *
18
+ * @return \Magento\Backend\Model\View\Result\Redirect
14
19
*/
15
20
public function execute ()
16
21
{
@@ -27,6 +32,9 @@ public function execute()
27
32
$ this ->messageManager ->addException ($ e , __ ('Something went wrong while unsubscribing you. ' ));
28
33
}
29
34
}
30
- $ this ->getResponse ()->setRedirect ($ this ->_redirect ->getRedirectUrl ());
35
+ /** @var \Magento\Backend\Model\View\Result\Redirect $redirect */
36
+ $ redirect = $ this ->resultFactory ->create (\Magento \Framework \Controller \ResultFactory::TYPE_REDIRECT );
37
+ $ redirectUrl = $ this ->_redirect ->getRedirectUrl ();
38
+ return $ redirect ->setUrl ($ redirectUrl );
31
39
}
32
40
}
You can’t perform that action at this time.
0 commit comments