Skip to content

Commit 6d955c8

Browse files
magento2-login-as-customer/issues/29: Static tests fix.
1 parent aa1543e commit 6d955c8

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

app/code/Magento/LoginAsCustomerUi/Controller/Adminhtml/Login/Login.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* Generate secret key and forward to the storefront action
3232
*
3333
* This action can be executed via GET request when "Store View To Login In" is disabled, and POST when it is enabled
34+
*
35+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3436
*/
3537
class Login extends Action implements HttpGetActionInterface, HttpPostActionInterface
3638
{

app/code/Magento/LoginAsCustomerUi/Plugin/AdminLogoutPlugin.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
namespace Magento\LoginAsCustomerUi\Plugin;
99

1010
use Magento\Backend\Model\Auth;
11-
use Magento\LoginAsCustomer\Model\Config;
11+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1212
use Magento\LoginAsCustomerApi\Api\DeleteExpiredAuthenticationDataInterface;
1313

14+
/**
15+
* Delete all Login as Customer sessions for logging out admin.
16+
*/
1417
class AdminLogoutPlugin
1518
{
1619
/**
17-
* @var Config
20+
* @var ConfigInterface
1821
*/
1922
private $config;
2023

@@ -24,18 +27,20 @@ class AdminLogoutPlugin
2427
private $deleteExpiredAuthenticationData;
2528

2629
/**
27-
* @param Config $config
30+
* @param ConfigInterface $config
2831
* @param DeleteExpiredAuthenticationDataInterface $deleteExpiredAuthenticationData
2932
*/
3033
public function __construct(
31-
Config $config,
34+
ConfigInterface $config,
3235
DeleteExpiredAuthenticationDataInterface $deleteExpiredAuthenticationData
3336
) {
3437
$this->config = $config;
3538
$this->deleteExpiredAuthenticationData = $deleteExpiredAuthenticationData;
3639
}
3740

3841
/**
42+
* Delete all Login as Customer sessions for logging out admin.
43+
*
3944
* @param Auth $subject
4045
*/
4146
public function beforeLogout(Auth $subject): void

app/code/Magento/LoginAsCustomerUi/Plugin/InvalidateExpiredSessionPlugin.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
88

99
use Magento\Customer\Model\Session;
1010
use Magento\Framework\App\ActionInterface;
11-
use Magento\LoginAsCustomer\Model\Config;
11+
use Magento\LoginAsCustomerApi\Api\ConfigInterface;
1212
use Magento\LoginAsCustomerApi\Api\IsLoginAsCustomerSessionActiveInterface;
13-
use Magento\Security\Model\AdminSessionInfoFactory;
1413

1514
/**
1615
* Invalidate expired and not active Login as Customer sessions.
1716
*/
1817
class InvalidateExpiredSessionPlugin
1918
{
2019
/**
21-
* @var Config
20+
* @var ConfigInterface
2221
*/
2322
private $config;
2423

@@ -33,24 +32,16 @@ class InvalidateExpiredSessionPlugin
3332
private $isLoginAsCustomerSessionActive;
3433

3534
/**
36-
* @var AdminSessionInfoFactory
37-
*/
38-
private $adminSessionInfoFactory;
39-
40-
/**
41-
* @param Config $config
35+
* @param ConfigInterface $config
4236
* @param Session $session
43-
* @param AdminSessionInfoFactory $adminSessionInfoFactory
4437
* @param IsLoginAsCustomerSessionActiveInterface $isLoginAsCustomerSessionActive
4538
*/
4639
public function __construct(
47-
Config $config,
40+
ConfigInterface $config,
4841
Session $session,
49-
AdminSessionInfoFactory $adminSessionInfoFactory,
5042
IsLoginAsCustomerSessionActiveInterface $isLoginAsCustomerSessionActive
5143
) {
5244
$this->session = $session;
53-
$this->adminSessionInfoFactory = $adminSessionInfoFactory;
5445
$this->isLoginAsCustomerSessionActive = $isLoginAsCustomerSessionActive;
5546
$this->config = $config;
5647
}
@@ -61,6 +52,7 @@ public function __construct(
6152
* @param ActionInterface $subject
6253
* @throws \Magento\Framework\Exception\LocalizedException
6354
* @throws \Magento\Framework\Exception\NoSuchEntityException
55+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
6456
*/
6557
public function beforeExecute(ActionInterface $subject)
6658
{

0 commit comments

Comments
 (0)