Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-integration
Model
CredentialsValidator.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Integration\Model
;
8
9
use
Magento\Framework\Exception\InputException
;
10
14
class
CredentialsValidator
15
{
24
public
function
validate
($username, $password)
25
{
26
$exception =
new
InputException
();
27
if
(!is_string($username) || strlen($username) == 0) {
28
$exception->addError(
__
(
'"%fieldName" is required. Enter and try again.'
, [
'fieldName'
=>
'username'
]));
29
}
30
if
(!is_string($password) || strlen($password) == 0) {
31
$exception->addError(
__
(
'"%fieldName" is required. Enter and try again.'
, [
'fieldName'
=>
'password'
]));
32
}
33
if
($exception->wasErrorAdded()) {
34
throw
$exception;
35
}
36
}
37
}
__
__()
Definition:
__.php:13
Magento\Framework\Exception\InputException
Definition:
InputException.php:17
Magento\Integration\Model\CredentialsValidator\validate
validate($username, $password)
Definition:
CredentialsValidator.php:24
Magento\Integration\Model\CredentialsValidator
Definition:
CredentialsValidator.php:14
Magento\Integration\Model
Definition:
AdminTokenServiceTest.php:7