Skip to content

Commit 889e676

Browse files
committed
Update fixes
1 parent e06f660 commit 889e676

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Magento\Framework\Reflection\DataObjectProcessor;
1818
use Magento\Framework\Exception\LocalizedException;
1919
use Magento\Store\Model\ScopeInterface;
20+
use Magento\Customer\Model\Data\CustomerSecure;
2021

2122
/**
2223
* Customer email notification
@@ -126,7 +127,7 @@ public function __construct(
126127
$this->customerViewHelper = $customerViewHelper;
127128
$this->dataProcessor = $dataProcessor;
128129
$this->scopeConfig = $scopeConfig;
129-
$this->senderResolver = $senderResolver ?: ObjectManager::getInstance()->get(SenderResolverInterface::class);
130+
$this->senderResolver = $senderResolver ?? ObjectManager::getInstance()->get(SenderResolverInterface::class);
130131
}
131132

132133
/**
@@ -141,7 +142,7 @@ public function credentialsChanged(
141142
CustomerInterface $savedCustomer,
142143
$origCustomerEmail,
143144
$isPasswordChanged = false
144-
) {
145+
): void {
145146
if ($origCustomerEmail != $savedCustomer->getEmail()) {
146147
if ($isPasswordChanged) {
147148
$this->emailAndPasswordChanged($savedCustomer, $origCustomerEmail);
@@ -166,7 +167,7 @@ public function credentialsChanged(
166167
* @param string $email
167168
* @return void
168169
*/
169-
private function emailAndPasswordChanged(CustomerInterface $customer, $email)
170+
private function emailAndPasswordChanged(CustomerInterface $customer, $email): void
170171
{
171172
$storeId = $customer->getStoreId();
172173
if (!$storeId) {
@@ -192,7 +193,7 @@ private function emailAndPasswordChanged(CustomerInterface $customer, $email)
192193
* @param string $email
193194
* @return void
194195
*/
195-
private function emailChanged(CustomerInterface $customer, $email)
196+
private function emailChanged(CustomerInterface $customer, $email): void
196197
{
197198
$storeId = $customer->getStoreId();
198199
if (!$storeId) {
@@ -217,7 +218,7 @@ private function emailChanged(CustomerInterface $customer, $email)
217218
* @param CustomerInterface $customer
218219
* @return void
219220
*/
220-
private function passwordReset(CustomerInterface $customer)
221+
private function passwordReset(CustomerInterface $customer): void
221222
{
222223
$storeId = $customer->getStoreId();
223224
if (!$storeId) {
@@ -254,7 +255,7 @@ private function sendEmailTemplate(
254255
$templateParams = [],
255256
$storeId = null,
256257
$email = null
257-
) {
258+
): void {
258259
$templateId = $this->scopeConfig->getValue($template, ScopeInterface::SCOPE_STORE, $storeId);
259260
if ($email === null) {
260261
$email = $customer->getEmail();
@@ -280,15 +281,15 @@ private function sendEmailTemplate(
280281
* Create an object with data merged from Customer and CustomerSecure
281282
*
282283
* @param CustomerInterface $customer
283-
* @return \Magento\Customer\Model\Data\CustomerSecure
284+
* @return CustomerSecure
284285
*/
285-
private function getFullCustomerObject($customer)
286+
private function getFullCustomerObject($customer): CustomerSecure
286287
{
287288
// No need to flatten the custom attributes or nested objects since the only usage is for email templates and
288289
// object passed for events
289290
$mergedCustomerData = $this->customerRegistry->retrieveSecureData($customer->getId());
290291
$customerData = $this->dataProcessor
291-
->buildOutputDataArray($customer, \Magento\Customer\Api\Data\CustomerInterface::class);
292+
->buildOutputDataArray($customer, CustomerInterface::class);
292293
$mergedCustomerData->addData($customerData);
293294
$mergedCustomerData->setData('name', $this->customerViewHelper->getCustomerName($customer));
294295
return $mergedCustomerData;
@@ -301,7 +302,7 @@ private function getFullCustomerObject($customer)
301302
* @param int|string|null $defaultStoreId
302303
* @return int
303304
*/
304-
private function getWebsiteStoreId($customer, $defaultStoreId = null)
305+
private function getWebsiteStoreId($customer, $defaultStoreId = null): int
305306
{
306307
if ($customer->getWebsiteId() != 0 && empty($defaultStoreId)) {
307308
$storeIds = $this->storeManager->getWebsite($customer->getWebsiteId())->getStoreIds();
@@ -316,7 +317,7 @@ private function getWebsiteStoreId($customer, $defaultStoreId = null)
316317
* @param CustomerInterface $customer
317318
* @return void
318319
*/
319-
public function passwordReminder(CustomerInterface $customer)
320+
public function passwordReminder(CustomerInterface $customer): void
320321
{
321322
$storeId = $customer->getStoreId();
322323
if (!$storeId) {
@@ -340,7 +341,7 @@ public function passwordReminder(CustomerInterface $customer)
340341
* @param CustomerInterface $customer
341342
* @return void
342343
*/
343-
public function passwordResetConfirmation(CustomerInterface $customer)
344+
public function passwordResetConfirmation(CustomerInterface $customer): void
344345
{
345346
$storeId = $customer->getStoreId();
346347
if (!$storeId) {
@@ -375,7 +376,7 @@ public function newAccount(
375376
$backUrl = '',
376377
$storeId = 0,
377378
$sendemailStoreId = null
378-
) {
379+
): void {
379380
$types = self::TEMPLATE_TYPES;
380381

381382
if (!isset($types[$type])) {

app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class EmailNotificationTest extends TestCase
3737

3838
private const STUB_EMAIL_IDENTIFIER = 'Template Identifier';
3939

40-
private const STUB_Sender = 'Sender';
40+
private const STUB_SENDER = 'Sender';
4141

4242
/**
4343
* @var \Magento\Customer\Model\CustomerRegistry|MockObject

0 commit comments

Comments
 (0)