Skip to content

Commit d7b382d

Browse files
AC-6695: Guest Checkout Fix
1 parent 8929886 commit d7b382d

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

app/code/Magento/Customer/Api/AccountManagementInterface.php

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
namespace Magento\Customer\Api;
99

1010
use Magento\Framework\Exception\InputException;
11+
use Magento\Framework\Exception\LocalizedException;
1112

1213
/**
1314
* Interface for managing customers accounts.
@@ -32,7 +33,7 @@ interface AccountManagementInterface
3233
* @param string $password
3334
* @param string $redirectUrl
3435
* @return \Magento\Customer\Api\Data\CustomerInterface
35-
* @throws \Magento\Framework\Exception\LocalizedException
36+
* @throws LocalizedException
3637
*/
3738
public function createAccount(
3839
\Magento\Customer\Api\Data\CustomerInterface $customer,
@@ -50,7 +51,7 @@ public function createAccount(
5051
* @return \Magento\Customer\Api\Data\CustomerInterface
5152
* @throws \Magento\Framework\Exception\InputException If bad input is provided
5253
* @throws \Magento\Framework\Exception\State\InputMismatchException If the provided email is already used
53-
* @throws \Magento\Framework\Exception\LocalizedException
54+
* @throws LocalizedException
5455
*/
5556
public function createAccountWithPasswordHash(
5657
\Magento\Customer\Api\Data\CustomerInterface $customer,
@@ -63,7 +64,7 @@ public function createAccountWithPasswordHash(
6364
*
6465
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
6566
* @return \Magento\Customer\Api\Data\ValidationResultsInterface
66-
* @throws \Magento\Framework\Exception\LocalizedException
67+
* @throws LocalizedException
6768
*/
6869
public function validate(\Magento\Customer\Api\Data\CustomerInterface $customer);
6970

@@ -73,7 +74,7 @@ public function validate(\Magento\Customer\Api\Data\CustomerInterface $customer)
7374
* @param int $customerId
7475
* @return bool
7576
* @throws \Magento\Framework\Exception\NoSuchEntityException If group is not found
76-
* @throws \Magento\Framework\Exception\LocalizedException
77+
* @throws LocalizedException
7778
*/
7879
public function isReadonly($customerId);
7980

@@ -83,7 +84,7 @@ public function isReadonly($customerId);
8384
* @param string $email
8485
* @param string $confirmationKey
8586
* @return \Magento\Customer\Api\Data\CustomerInterface
86-
* @throws \Magento\Framework\Exception\LocalizedException
87+
* @throws LocalizedException
8788
*/
8889
public function activate($email, $confirmationKey);
8990

@@ -93,7 +94,7 @@ public function activate($email, $confirmationKey);
9394
* @param int $customerId
9495
* @param string $confirmationKey
9596
* @return \Magento\Customer\Api\Data\CustomerInterface
96-
* @throws \Magento\Framework\Exception\LocalizedException
97+
* @throws LocalizedException
9798
*/
9899
public function activateById($customerId, $confirmationKey);
99100

@@ -103,7 +104,7 @@ public function activateById($customerId, $confirmationKey);
103104
* @param string $email
104105
* @param string $password
105106
* @return \Magento\Customer\Api\Data\CustomerInterface
106-
* @throws \Magento\Framework\Exception\LocalizedException
107+
* @throws LocalizedException
107108
*/
108109
public function authenticate($email, $password);
109110

@@ -114,7 +115,7 @@ public function authenticate($email, $password);
114115
* @param string $currentPassword
115116
* @param string $newPassword
116117
* @return bool true on success
117-
* @throws \Magento\Framework\Exception\LocalizedException
118+
* @throws LocalizedException
118119
*/
119120
public function changePassword($email, $currentPassword, $newPassword);
120121

@@ -125,7 +126,7 @@ public function changePassword($email, $currentPassword, $newPassword);
125126
* @param string $currentPassword
126127
* @param string $newPassword
127128
* @return bool true on success
128-
* @throws \Magento\Framework\Exception\LocalizedException
129+
* @throws LocalizedException
129130
*/
130131
public function changePasswordById($customerId, $currentPassword, $newPassword);
131132

@@ -136,7 +137,7 @@ public function changePasswordById($customerId, $currentPassword, $newPassword);
136137
* @param string $template
137138
* @param int $websiteId
138139
* @return bool true on success
139-
* @throws \Magento\Framework\Exception\LocalizedException
140+
* @throws LocalizedException
140141
*/
141142
public function initiatePasswordReset($email, $template, $websiteId = null);
142143

@@ -149,7 +150,7 @@ public function initiatePasswordReset($email, $template, $websiteId = null);
149150
* @param string $newPassword
150151
*
151152
* @return bool true on success
152-
* @throws \Magento\Framework\Exception\LocalizedException
153+
* @throws LocalizedException
153154
* @throws InputException
154155
*/
155156
public function resetPassword($email, $resetToken, $newPassword);
@@ -166,7 +167,7 @@ public function resetPassword($email, $resetToken, $newPassword);
166167
* @throws \Magento\Framework\Exception\State\ExpiredException If token is expired
167168
* @throws \Magento\Framework\Exception\InputException If token or customer id is invalid
168169
* @throws \Magento\Framework\Exception\NoSuchEntityException If customer doesn't exist
169-
* @throws \Magento\Framework\Exception\LocalizedException
170+
* @throws LocalizedException
170171
*/
171172
public function validateResetPasswordLinkToken($customerId, $resetPasswordLinkToken);
172173

@@ -175,7 +176,7 @@ public function validateResetPasswordLinkToken($customerId, $resetPasswordLinkTo
175176
*
176177
* @param int $customerId
177178
* @return string
178-
* @throws \Magento\Framework\Exception\LocalizedException
179+
* @throws LocalizedException
179180
*/
180181
public function getConfirmationStatus($customerId);
181182

@@ -186,27 +187,27 @@ public function getConfirmationStatus($customerId);
186187
* @param int $websiteId
187188
* @param string $redirectUrl
188189
* @return bool true on success
189-
* @throws \Magento\Framework\Exception\LocalizedException
190+
* @throws LocalizedException
190191
*/
191192
public function resendConfirmation($email, $websiteId, $redirectUrl = '');
192193

193194
/**
194195
* Check if given email is associated with a customer account in given website.
195196
*
196197
* @param string $customerEmail
197-
* @param int $websiteId If not set, will use the current websiteId
198+
* @param int|null $websiteId If not set, will use the current websiteId
198199
* @return bool
199-
* @throws \Magento\Framework\Exception\LocalizedException
200+
* @throws LocalizedException
200201
*/
201-
public function isEmailAvailable($customerEmail, $websiteId = null);
202+
public function isEmailAvailable(string $customerEmail, int $websiteId = null): bool;
202203

203204
/**
204205
* Check store availability for customer given the customerId.
205206
*
206207
* @param int $customerWebsiteId
207208
* @param int $storeId
208209
* @return bool
209-
* @throws \Magento\Framework\Exception\LocalizedException
210+
* @throws LocalizedException
210211
*/
211212
public function isCustomerInStore($customerWebsiteId, $storeId);
212213

@@ -216,7 +217,7 @@ public function isCustomerInStore($customerWebsiteId, $storeId);
216217
* @param int $customerId
217218
* @return \Magento\Customer\Api\Data\AddressInterface
218219
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
219-
* @throws \Magento\Framework\Exception\LocalizedException
220+
* @throws LocalizedException
220221
*/
221222
public function getDefaultBillingAddress($customerId);
222223

@@ -226,7 +227,7 @@ public function getDefaultBillingAddress($customerId);
226227
* @param int $customerId
227228
* @return \Magento\Customer\Api\Data\AddressInterface
228229
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
229-
* @throws \Magento\Framework\Exception\LocalizedException
230+
* @throws LocalizedException
230231
*/
231232
public function getDefaultShippingAddress($customerId);
232233

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ public function validate(CustomerInterface $customer)
11431143
/**
11441144
* @inheritdoc
11451145
*/
1146-
public function isEmailAvailable($customerEmail, $websiteId = null)
1146+
public function isEmailAvailable(string $customerEmail, int $websiteId = null): bool
11471147
{
11481148
$guestLoginConfig = $this->scopeConfig->getValue(
11491149
self::GUEST_CHECKOUT_LOGIN_OPTION_SYS_CONFIG,

0 commit comments

Comments
 (0)