Skip to content

Commit 5727384

Browse files
committed
magento/magento2#: Replace deprecated addError, addSuccess, addException methods in Magento/Customer/Controller/Account/Confirmation.php
1 parent 099c639 commit 5727384

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

app/code/Magento/Customer/Controller/Account/Confirmation.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
<?php
22
/**
3-
*
43
* Copyright © Magento, Inc. All rights reserved.
54
* See COPYING.txt for license details.
65
*/
76
namespace Magento\Customer\Controller\Account;
87

8+
use Magento\Customer\Api\AccountManagementInterface;
9+
use Magento\Customer\Controller\AbstractAccount;
10+
use Magento\Customer\Model\Session;
911
use Magento\Customer\Model\Url;
12+
use Magento\Framework\App\ActionInterface as ActionInterface;
1013
use Magento\Framework\App\Action\Context;
11-
use Magento\Customer\Model\Session;
1214
use Magento\Framework\App\ObjectManager;
15+
use Magento\Framework\Exception\State\InvalidTransitionException;
1316
use Magento\Framework\View\Result\PageFactory;
1417
use Magento\Store\Model\StoreManagerInterface;
15-
use Magento\Customer\Api\AccountManagementInterface;
16-
use Magento\Framework\Exception\State\InvalidTransitionException;
1718

18-
class Confirmation extends \Magento\Customer\Controller\AbstractAccount
19+
/**
20+
* Class Confirmation. Send confirmation link to specified email
21+
*/
22+
class Confirmation extends AbstractAccount implements ActionInterface
1923
{
2024
/**
2125
* @var \Magento\Store\Model\StoreManagerInterface
@@ -91,11 +95,11 @@ public function execute()
9195
$email,
9296
$this->storeManager->getStore()->getWebsiteId()
9397
);
94-
$this->messageManager->addSuccess(__('Please check your email for confirmation key.'));
98+
$this->messageManager->addSuccessMessage(__('Please check your email for confirmation key.'));
9599
} catch (InvalidTransitionException $e) {
96-
$this->messageManager->addSuccess(__('This email does not require confirmation.'));
100+
$this->messageManager->addSuccessMessage(__('This email does not require confirmation.'));
97101
} catch (\Exception $e) {
98-
$this->messageManager->addException($e, __('Wrong email.'));
102+
$this->messageManager->addExceptionMessage($e, __('Wrong email.'));
99103
$resultRedirect->setPath('*/*/*', ['email' => $email, '_secure' => true]);
100104
return $resultRedirect;
101105
}

0 commit comments

Comments
 (0)