8
8
namespace Magento \Customer \Api ;
9
9
10
10
use Magento \Framework \Exception \InputException ;
11
+ use Magento \Framework \Exception \LocalizedException ;
11
12
12
13
/**
13
14
* Interface for managing customers accounts.
@@ -32,7 +33,7 @@ interface AccountManagementInterface
32
33
* @param string $password
33
34
* @param string $redirectUrl
34
35
* @return \Magento\Customer\Api\Data\CustomerInterface
35
- * @throws \Magento\Framework\Exception\ LocalizedException
36
+ * @throws LocalizedException
36
37
*/
37
38
public function createAccount (
38
39
\Magento \Customer \Api \Data \CustomerInterface $ customer ,
@@ -50,7 +51,7 @@ public function createAccount(
50
51
* @return \Magento\Customer\Api\Data\CustomerInterface
51
52
* @throws \Magento\Framework\Exception\InputException If bad input is provided
52
53
* @throws \Magento\Framework\Exception\State\InputMismatchException If the provided email is already used
53
- * @throws \Magento\Framework\Exception\ LocalizedException
54
+ * @throws LocalizedException
54
55
*/
55
56
public function createAccountWithPasswordHash (
56
57
\Magento \Customer \Api \Data \CustomerInterface $ customer ,
@@ -63,7 +64,7 @@ public function createAccountWithPasswordHash(
63
64
*
64
65
* @param \Magento\Customer\Api\Data\CustomerInterface $customer
65
66
* @return \Magento\Customer\Api\Data\ValidationResultsInterface
66
- * @throws \Magento\Framework\Exception\ LocalizedException
67
+ * @throws LocalizedException
67
68
*/
68
69
public function validate (\Magento \Customer \Api \Data \CustomerInterface $ customer );
69
70
@@ -73,7 +74,7 @@ public function validate(\Magento\Customer\Api\Data\CustomerInterface $customer)
73
74
* @param int $customerId
74
75
* @return bool
75
76
* @throws \Magento\Framework\Exception\NoSuchEntityException If group is not found
76
- * @throws \Magento\Framework\Exception\ LocalizedException
77
+ * @throws LocalizedException
77
78
*/
78
79
public function isReadonly ($ customerId );
79
80
@@ -83,7 +84,7 @@ public function isReadonly($customerId);
83
84
* @param string $email
84
85
* @param string $confirmationKey
85
86
* @return \Magento\Customer\Api\Data\CustomerInterface
86
- * @throws \Magento\Framework\Exception\ LocalizedException
87
+ * @throws LocalizedException
87
88
*/
88
89
public function activate ($ email , $ confirmationKey );
89
90
@@ -93,7 +94,7 @@ public function activate($email, $confirmationKey);
93
94
* @param int $customerId
94
95
* @param string $confirmationKey
95
96
* @return \Magento\Customer\Api\Data\CustomerInterface
96
- * @throws \Magento\Framework\Exception\ LocalizedException
97
+ * @throws LocalizedException
97
98
*/
98
99
public function activateById ($ customerId , $ confirmationKey );
99
100
@@ -103,7 +104,7 @@ public function activateById($customerId, $confirmationKey);
103
104
* @param string $email
104
105
* @param string $password
105
106
* @return \Magento\Customer\Api\Data\CustomerInterface
106
- * @throws \Magento\Framework\Exception\ LocalizedException
107
+ * @throws LocalizedException
107
108
*/
108
109
public function authenticate ($ email , $ password );
109
110
@@ -114,7 +115,7 @@ public function authenticate($email, $password);
114
115
* @param string $currentPassword
115
116
* @param string $newPassword
116
117
* @return bool true on success
117
- * @throws \Magento\Framework\Exception\ LocalizedException
118
+ * @throws LocalizedException
118
119
*/
119
120
public function changePassword ($ email , $ currentPassword , $ newPassword );
120
121
@@ -125,7 +126,7 @@ public function changePassword($email, $currentPassword, $newPassword);
125
126
* @param string $currentPassword
126
127
* @param string $newPassword
127
128
* @return bool true on success
128
- * @throws \Magento\Framework\Exception\ LocalizedException
129
+ * @throws LocalizedException
129
130
*/
130
131
public function changePasswordById ($ customerId , $ currentPassword , $ newPassword );
131
132
@@ -136,7 +137,7 @@ public function changePasswordById($customerId, $currentPassword, $newPassword);
136
137
* @param string $template
137
138
* @param int $websiteId
138
139
* @return bool true on success
139
- * @throws \Magento\Framework\Exception\ LocalizedException
140
+ * @throws LocalizedException
140
141
*/
141
142
public function initiatePasswordReset ($ email , $ template , $ websiteId = null );
142
143
@@ -149,7 +150,7 @@ public function initiatePasswordReset($email, $template, $websiteId = null);
149
150
* @param string $newPassword
150
151
*
151
152
* @return bool true on success
152
- * @throws \Magento\Framework\Exception\ LocalizedException
153
+ * @throws LocalizedException
153
154
* @throws InputException
154
155
*/
155
156
public function resetPassword ($ email , $ resetToken , $ newPassword );
@@ -166,7 +167,7 @@ public function resetPassword($email, $resetToken, $newPassword);
166
167
* @throws \Magento\Framework\Exception\State\ExpiredException If token is expired
167
168
* @throws \Magento\Framework\Exception\InputException If token or customer id is invalid
168
169
* @throws \Magento\Framework\Exception\NoSuchEntityException If customer doesn't exist
169
- * @throws \Magento\Framework\Exception\ LocalizedException
170
+ * @throws LocalizedException
170
171
*/
171
172
public function validateResetPasswordLinkToken ($ customerId , $ resetPasswordLinkToken );
172
173
@@ -175,7 +176,7 @@ public function validateResetPasswordLinkToken($customerId, $resetPasswordLinkTo
175
176
*
176
177
* @param int $customerId
177
178
* @return string
178
- * @throws \Magento\Framework\Exception\ LocalizedException
179
+ * @throws LocalizedException
179
180
*/
180
181
public function getConfirmationStatus ($ customerId );
181
182
@@ -186,27 +187,27 @@ public function getConfirmationStatus($customerId);
186
187
* @param int $websiteId
187
188
* @param string $redirectUrl
188
189
* @return bool true on success
189
- * @throws \Magento\Framework\Exception\ LocalizedException
190
+ * @throws LocalizedException
190
191
*/
191
192
public function resendConfirmation ($ email , $ websiteId , $ redirectUrl = '' );
192
193
193
194
/**
194
195
* Check if given email is associated with a customer account in given website.
195
196
*
196
197
* @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
198
199
* @return bool
199
- * @throws \Magento\Framework\Exception\ LocalizedException
200
+ * @throws LocalizedException
200
201
*/
201
- public function isEmailAvailable ($ customerEmail , $ websiteId = null );
202
+ public function isEmailAvailable (string $ customerEmail , int $ websiteId = null ): bool ;
202
203
203
204
/**
204
205
* Check store availability for customer given the customerId.
205
206
*
206
207
* @param int $customerWebsiteId
207
208
* @param int $storeId
208
209
* @return bool
209
- * @throws \Magento\Framework\Exception\ LocalizedException
210
+ * @throws LocalizedException
210
211
*/
211
212
public function isCustomerInStore ($ customerWebsiteId , $ storeId );
212
213
@@ -216,7 +217,7 @@ public function isCustomerInStore($customerWebsiteId, $storeId);
216
217
* @param int $customerId
217
218
* @return \Magento\Customer\Api\Data\AddressInterface
218
219
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
219
- * @throws \Magento\Framework\Exception\ LocalizedException
220
+ * @throws LocalizedException
220
221
*/
221
222
public function getDefaultBillingAddress ($ customerId );
222
223
@@ -226,7 +227,7 @@ public function getDefaultBillingAddress($customerId);
226
227
* @param int $customerId
227
228
* @return \Magento\Customer\Api\Data\AddressInterface
228
229
* @throws \Magento\Framework\Exception\NoSuchEntityException If the customer Id is invalid
229
- * @throws \Magento\Framework\Exception\ LocalizedException
230
+ * @throws LocalizedException
230
231
*/
231
232
public function getDefaultShippingAddress ($ customerId );
232
233
0 commit comments