Skip to content

Commit 2ba0163

Browse files
committed
Better way to fix the false positive
1 parent b68e049 commit 2ba0163

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

app/code/Magento/LoginAsCustomerAssistance/Plugin/CustomerDataValidatePlugin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use Magento\Framework\App\RequestInterface;
1212
use Magento\Framework\AuthorizationInterface;
1313
use Magento\Framework\Message\MessageInterface;
14-
use Magento\Framework\Validator\Exception;
14+
use Magento\Framework\Validator\Exception as ValidatorException;
1515
use Magento\LoginAsCustomerAssistance\Api\IsAssistanceEnabledInterface;
1616
use Magento\LoginAsCustomerAssistance\Model\ResourceModel\GetLoginAsCustomerAssistanceAllowed;
1717

@@ -49,7 +49,7 @@ public function __construct(
4949
* @param RequestInterface $request
5050
* @param null|string $scope
5151
* @param bool $scopeOnly
52-
* @throws Exception
52+
* @throws ValidatorException
5353
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
5454
*/
5555
public function beforeExtractData(
@@ -75,8 +75,7 @@ public function beforeExtractData(
7575
],
7676
];
7777

78-
// phpcs:ignore Magento2.Exceptions.DirectThrow
79-
throw new Exception(null, null, $errorMessages);
78+
throw new ValidatorException(null, null, $errorMessages);
8079
}
8180
}
8281
}

0 commit comments

Comments
 (0)