Skip to content

Commit ef0f033

Browse files
committed
magento2-login-as-customer/issues/104: Global refactoring
- Extract LoginAsCustomerApi
1 parent 085746e commit ef0f033

28 files changed

+188
-45
lines changed

app/code/Magento/LoginAsCustomer/Cron/DeleteExpiredAuthenticationData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace Magento\LoginAsCustomer\Cron;
99

10-
use Magento\LoginAsCustomer\Api\ConfigInterface;
11-
use Magento\LoginAsCustomer\Api\DeleteExpiredAuthenticationDataInterface;
10+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
11+
use Magento\LoginAsCustomerApi\Api\DeleteExpiredAuthenticationDataInterface;
1212

1313
/**
1414
* elete expired authentication data cron task

app/code/Magento/LoginAsCustomer/Model/AuthenticateCustomer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
use Magento\Customer\Model\Session;
1111
use Magento\Framework\Exception\LocalizedException;
12-
use Magento\LoginAsCustomer\Api\AuthenticateCustomerInterface;
13-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface;
12+
use Magento\LoginAsCustomerApi\Api\AuthenticateCustomerInterface;
13+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
1414

1515
/**
1616
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/AuthenticationData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
namespace Magento\LoginAsCustomer\Model;
99

10-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface;
11-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataExtensionInterface;
10+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
11+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataExtensionInterface;
1212

1313
/**
1414
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\LoginAsCustomer\Model;
99

1010
use Magento\Framework\App\Config\ScopeConfigInterface;
11-
use Magento\LoginAsCustomer\Api\ConfigInterface;
11+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1212

1313
/**
1414
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteAuthenticationDataBySecret.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
namespace Magento\LoginAsCustomer\Model\ResourceModel;
99

1010
use Magento\Framework\App\ResourceConnection;
11-
use Magento\LoginAsCustomer\Api\DeleteAuthenticationDataBySecretInterface;
11+
use Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataBySecretInterface;
1212

1313
/**
1414
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/ResourceModel/DeleteExpiredAuthenticationData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Framework\Stdlib\DateTime\DateTime;
12-
use Magento\LoginAsCustomer\Api\ConfigInterface;
13-
use Magento\LoginAsCustomer\Api\DeleteExpiredAuthenticationDataInterface;
12+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
13+
use Magento\LoginAsCustomerApi\Api\DeleteExpiredAuthenticationDataInterface;
1414

1515
/**
1616
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/ResourceModel/GetAuthenticationDataBySecret.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Framework\Stdlib\DateTime\DateTime;
1212
use Magento\Framework\Exception\LocalizedException;
13-
use Magento\LoginAsCustomer\Api\ConfigInterface;
14-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface;
15-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterfaceFactor;
16-
use Magento\LoginAsCustomer\Api\GetAuthenticationDataBySecretInterface;
13+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
14+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
15+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterfaceFactor;
16+
use Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface;
1717

1818
/**
1919
* @inheritdoc

app/code/Magento/LoginAsCustomer/Model/ResourceModel/SaveAuthenticationData.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
use Magento\Framework\App\ResourceConnection;
1111
use Magento\Framework\Stdlib\DateTime\DateTime;
1212
use Magento\Framework\Math\Random;
13-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface;
14-
use Magento\LoginAsCustomer\Api\SaveAuthenticationDataInterface;
13+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
14+
use Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface;
1515

1616
/**
1717
* @inheritdoc

app/code/Magento/LoginAsCustomer/etc/di.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
9-
<preference for="Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\AuthenticationData"/>
10-
<preference for="Magento\LoginAsCustomer\Api\SaveAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\SaveAuthenticationData"/>
11-
<preference for="Magento\LoginAsCustomer\Api\GetAuthenticationDataBySecretInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\GetAuthenticationDataBySecret"/>
12-
<preference for="Magento\LoginAsCustomer\Api\AuthenticateCustomerInterface" type="Magento\LoginAsCustomer\Model\AuthenticateCustomer"/>
13-
<preference for="Magento\LoginAsCustomer\Api\DeleteAuthenticationDataBySecretInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\DeleteAuthenticationDataBySecret"/>
14-
<preference for="Magento\LoginAsCustomer\Api\DeleteExpiredAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\DeleteExpiredAuthenticationData"/>
15-
<preference for="Magento\LoginAsCustomer\Api\ConfigInterface" type="Magento\LoginAsCustomer\Model\Config"/>
9+
<preference for="Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\AuthenticationData"/>
10+
<preference for="Magento\LoginAsCustomerApi\Api\SaveAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\SaveAuthenticationData"/>
11+
<preference for="Magento\LoginAsCustomerApi\Api\GetAuthenticationDataBySecretInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\GetAuthenticationDataBySecret"/>
12+
<preference for="Magento\LoginAsCustomerApi\Api\AuthenticateCustomerInterface" type="Magento\LoginAsCustomer\Model\AuthenticateCustomer"/>
13+
<preference for="Magento\LoginAsCustomerApi\Api\DeleteAuthenticationDataBySecretInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\DeleteAuthenticationDataBySecret"/>
14+
<preference for="Magento\LoginAsCustomerApi\Api\DeleteExpiredAuthenticationDataInterface" type="Magento\LoginAsCustomer\Model\ResourceModel\DeleteExpiredAuthenticationData"/>
15+
<preference for="Magento\LoginAsCustomerApi\Api\ConfigInterface" type="Magento\LoginAsCustomer\Model\Config"/>
1616
</config>

app/code/Magento/LoginAsCustomer/Api/AuthenticateCustomerInterface.php renamed to app/code/Magento/LoginAsCustomerApi/Api/AuthenticateCustomerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*/
66
declare(strict_types=1);
77

8-
namespace Magento\LoginAsCustomer\Api;
8+
namespace Magento\LoginAsCustomerApi\Api;
99

1010
use Magento\Framework\Exception\LocalizedException;
11-
use Magento\LoginAsCustomer\Api\Data\AuthenticationDataInterface;
11+
use Magento\LoginAsCustomerApi\Api\Data\AuthenticationDataInterface;
1212

1313
/**
1414
* Authenticate a customer

0 commit comments

Comments
 (0)