Skip to content

Commit 26f8d92

Browse files
author
David Alger
committed
MAGETWO-37843: All responsive email templates in Blank Theme
- removed unused constructor param - other minor fixes
1 parent 3d555e0 commit 26f8d92

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

app/code/Magento/Customer/Model/AccountManagement.php

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
use Magento\Customer\Api\CustomerRepositoryInterface;
1515
use Magento\Customer\Api\Data\AddressInterface;
1616
use Magento\Customer\Api\Data\CustomerInterface;
17+
use Magento\Customer\Api\Data\ValidationResultsInterfaceFactory;
1718
use Magento\Customer\Helper\View as CustomerViewHelper;
1819
use Magento\Customer\Model\Config\Share as ConfigShare;
1920
use Magento\Customer\Model\Customer as CustomerModel;
2021
use Magento\Customer\Model\Metadata\Validator;
22+
use Magento\Framework\Api\ExtensibleDataObjectConverter;
2123
use Magento\Framework\App\Config\ScopeConfigInterface;
2224
use Magento\Framework\Encryption\EncryptorInterface as Encryptor;
2325
use Magento\Framework\Event\ManagerInterface;
@@ -30,6 +32,8 @@
3032
use Magento\Framework\Exception\State\ExpiredException;
3133
use Magento\Framework\Exception\State\InputMismatchException;
3234
use Magento\Framework\Exception\State\InvalidTransitionException;
35+
use Magento\Framework\ObjectFactory;
36+
use Magento\Framework\Registry;
3337
use Psr\Log\LoggerInterface as PsrLogger;
3438
use Magento\Framework\Exception\MailException;
3539
use Magento\Framework\Mail\Template\TransportBuilder;
@@ -205,11 +209,10 @@ class AccountManagement implements AccountManagementInterface
205209
* @param StoreManagerInterface $storeManager
206210
* @param Random $mathRandom
207211
* @param Validator $validator
208-
* @param \Magento\Customer\Api\Data\ValidationResultsInterfaceFactory $validationResultsDataFactory
212+
* @param ValidationResultsInterfaceFactory $validationResultsDataFactory
209213
* @param AddressRepositoryInterface $addressRepository
210214
* @param CustomerMetadataInterface $customerMetadataService
211215
* @param CustomerRegistry $customerRegistry
212-
* @param \Magento\Framework\Url $url
213216
* @param PsrLogger $logger
214217
* @param Encryptor $encryptor
215218
* @param ConfigShare $configShare
@@ -218,12 +221,12 @@ class AccountManagement implements AccountManagementInterface
218221
* @param ScopeConfigInterface $scopeConfig
219222
* @param TransportBuilder $transportBuilder
220223
* @param DataObjectProcessor $dataProcessor
221-
* @param \Magento\Framework\Registry $registry
224+
* @param Registry $registry
222225
* @param CustomerViewHelper $customerViewHelper
223226
* @param DateTime $dateTime
224227
* @param CustomerModel $customerModel
225-
* @param \Magento\Framework\ObjectFactory $objectFactory
226-
* @param \Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter
228+
* @param ObjectFactory $objectFactory
229+
* @param ExtensibleDataObjectConverter $extensibleDataObjectConverter
227230
*
228231
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
229232
*/
@@ -233,11 +236,10 @@ public function __construct(
233236
StoreManagerInterface $storeManager,
234237
Random $mathRandom,
235238
Validator $validator,
236-
\Magento\Customer\Api\Data\ValidationResultsInterfaceFactory $validationResultsDataFactory,
239+
ValidationResultsInterfaceFactory $validationResultsDataFactory,
237240
AddressRepositoryInterface $addressRepository,
238241
CustomerMetadataInterface $customerMetadataService,
239242
CustomerRegistry $customerRegistry,
240-
\Magento\Framework\Url $url,
241243
PsrLogger $logger,
242244
Encryptor $encryptor,
243245
ConfigShare $configShare,
@@ -246,12 +248,12 @@ public function __construct(
246248
ScopeConfigInterface $scopeConfig,
247249
TransportBuilder $transportBuilder,
248250
DataObjectProcessor $dataProcessor,
249-
\Magento\Framework\Registry $registry,
251+
Registry $registry,
250252
CustomerViewHelper $customerViewHelper,
251253
DateTime $dateTime,
252254
CustomerModel $customerModel,
253-
\Magento\Framework\ObjectFactory $objectFactory,
254-
\Magento\Framework\Api\ExtensibleDataObjectConverter $extensibleDataObjectConverter
255+
ObjectFactory $objectFactory,
256+
ExtensibleDataObjectConverter $extensibleDataObjectConverter
255257
) {
256258
$this->customerFactory = $customerFactory;
257259
$this->eventManager = $eventManager;
@@ -614,18 +616,19 @@ public function changePasswordById($customerId, $currentPassword, $newPassword)
614616
/**
615617
* Change customer password.
616618
*
617-
* @param string $email
619+
* @param CustomerModel $customer
618620
* @param string $currentPassword
619621
* @param string $newPassword
620622
* @return bool true on success
623+
* @throws InputException
624+
* @throws InvalidEmailOrPasswordException
621625
*/
622626
private function changePasswordForCustomer($customer, $currentPassword, $newPassword)
623627
{
624628
$customerSecure = $this->customerRegistry->retrieveSecureData($customer->getId());
625629
$hash = $customerSecure->getPasswordHash();
626630
if (!$this->encryptor->validateHash($currentPassword, $hash)) {
627-
throw new InvalidEmailOrPasswordException(
628-
__('The password doesn\'t match this account.'));
631+
throw new InvalidEmailOrPasswordException(__('The password doesn\'t match this account.'));
629632
}
630633
$customerSecure->setRpToken(null);
631634
$customerSecure->setRpTokenCreatedAt(null);

0 commit comments

Comments
 (0)