Function isActive
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function isActive($userId = null)
{
$isActive = false;
if (empty($userId)) {
$userId = \App\User::getCurrentUserRealId();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '45', column '30'). Open
$this->authenticator = new \PragmaRX\Google2FA\Google2FA();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '87', column '26'). Open
$qrCodeGenerator = new \Milon\Barcode\DNS2D();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '99', column '13'). Open
throw new \App\Exceptions\NotAllowedMethod('LBL_NOT_EXIST: ' . $type);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class 'App\Config' in method 'isActive'. Open
switch (App\Config::security('USER_AUTHY_MODE')) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'App\Config' in method 'createQrCode'. Open
$qrCodeGenerator->setStorPath(__DIR__ . App\Config::main('tmp_dir'));
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\User' in method 'isActive'. Open
$userId = \App\User::getCurrentUserRealId();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'App\Config' in method 'getOtpAuthUrl'. Open
$issuer = parse_url(App\Config::main('site_URL'))['host'] ?? '';
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\User' in method 'isActive'. Open
$userModel = \App\User::getUserModel($userId);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\User' in method 'mustInit'. Open
$userId = \App\User::getCurrentUserRealId();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "QRCODE" 3 times. Open
return $qrCodeGenerator->getBarcodeHTML($otpAuthUrl, 'QRCODE');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Property \Users_Totp_Authmethod->authenticator
has undeclared type \PragmaRX\Google2FA\Google2FA
Open
private $authenticator;
- Exclude checks
Call to method setStorPath
from undeclared class \Milon\Barcode\DNS2D
Open
$qrCodeGenerator->setStorPath(__DIR__ . App\Config::main('tmp_dir'));
- Exclude checks
Call to method getBarcodePNG
from undeclared class \Milon\Barcode\DNS2D
Open
return '<img src="data:image/png;base64,' . $qrCodeGenerator->getBarcodePNG($otpAuthUrl, 'QRCODE', 10, 10) . '" alt="QR code" class="col-auto p-0" />';
- Exclude checks
Call to method getQRCodeUrl
from undeclared class \PragmaRX\Google2FA\Google2FA
Open
return $this->authenticator->getQRCodeUrl($issuer, $name, $secret);
- Exclude checks
Return type of createQrCode()
is undeclared type \Milon\Barcode\path
Open
private function createQrCode($otpAuthUrl, $type = 'HTML')
- Exclude checks
Call to method verifyKey
from undeclared class \PragmaRX\Google2FA\Google2FA
Open
return $this->authenticator->verifyKey($secret, (string) $userCode);
- Exclude checks
Call to method generateSecretKey
from undeclared class \PragmaRX\Google2FA\Google2FA
Open
return $this->secret = $this->authenticator->generateSecretKey();
- Exclude checks
Call to method __construct
from undeclared class \Milon\Barcode\DNS2D
Open
$qrCodeGenerator = new \Milon\Barcode\DNS2D();
- Exclude checks
Return type of createQrCodeForUser()
is undeclared type \Milon\Barcode\path
Open
public function createQrCodeForUser($type = 'PNG')
- Exclude checks
Call to method getUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
return $this->createQrCode($this->getOtpAuthUrl($this->secret, \App\User::getUserModel($this->userId)->getDetail('user_name')), $type);
- Exclude checks
Call to method __construct
from undeclared class \PragmaRX\Google2FA\Google2FA
Open
$this->authenticator = new \PragmaRX\Google2FA\Google2FA();
- Exclude checks
Call to method getBarcodeSVG
from undeclared class \Milon\Barcode\DNS2D
Open
return $qrCodeGenerator->getBarcodeSVG($otpAuthUrl, 'QRCODE');
- Exclude checks
Call to method getBarcodeHTML
from undeclared class \Milon\Barcode\DNS2D
Open
return $qrCodeGenerator->getBarcodeHTML($otpAuthUrl, 'QRCODE');
- Exclude checks
Call to method getCurrentOtp
from undeclared class \PragmaRX\Google2FA\Google2FA
Open
return $this->authenticator->getCurrentOtp($this->secret);
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = \App\User::getCurrentUserRealId();
- Exclude checks
Call to method getUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userModel = \App\User::getUserModel($userId);
- Exclude checks
Call to method getCurrentUserRealId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = \App\User::getCurrentUserRealId();
- Exclude checks
Call to method getUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
return empty(\App\User::getUserModel($userId)->getDetail('authy_secret_totp'));
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Users_Totp_Authmethod
- Exclude checks
The class Users_Totp_Authmethod is not named in CamelCase. Open
class Users_Totp_Authmethod
{
/**
* @var string[] User authentication mode possible values.
* TOTP_OFF - 2FA TOTP is checking off
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string - Secret code */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $name - The name is used to identify which account a key is associated with.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var \PragmaRX\Google2FA\Google2FA */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var string[] User authentication mode possible values.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getOtpAuthUrl($secret, $name, $issuer = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* TOTP_OPTIONAL - It is defined by the user
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* TOTP_OBLIGATORY - It is obligatory.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $authenticator;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* TOTP_OFF - 2FA TOTP is checking off
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $issuer - The issuer parameter is a string value indicating the provider or service this account is associated with, URL-encoded according to RFC 3986.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->authenticator = new \PragmaRX\Google2FA\Google2FA();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$issuer = parse_url(App\Config::main('site_URL'))['host'] ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->authenticator->getQRCodeUrl($issuer, $name, $secret);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null === $issuer) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const ALLOWED_USER_AUTHY_MODE = ['TOTP_OFF', 'TOTP_OPTIONAL', 'TOTP_OBLIGATORY'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $userId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->userId = $userId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Generate TOTP code url.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $secret;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Constructor.
- Exclude checks
Line exceeds 120 characters; contains 218 characters Open
* @param string $secret - REQUIRED: The secret parameter is an arbitrary key value encoded in Base32 according to RFC 3548. The padding specified in RFC 3548 section 2.2 is not required and should be omitted.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __construct(int $userId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var int - User id */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $secret - REQUIRED: The secret parameter is an arbitrary key value encoded in Base32 according to RFC 3548. The padding specified in RFC 3548 section 2.2 is not required and should be omitted.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Line exceeds 120 characters; contains 177 characters Open
* @param string|null $issuer - The issuer parameter is a string value indicating the provider or service this account is associated with, URL-encoded according to RFC 3986.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string - Url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userId - Id of user
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Milon\Barcode\path|string - HTML code
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qrCodeGenerator->setStorPath(__DIR__ . App\Config::main('tmp_dir'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creating a secret code for TOTP.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\NotAllowedMethod
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function createQrCodeForUser($type = 'PNG')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isActive = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function createSecret()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $secret
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isActive = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->authenticator->getCurrentOtp($this->secret);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userId = \App\User::getCurrentUserRealId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userModel = \App\User::getUserModel($userId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch (App\Config::security('USER_AUTHY_MODE')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function mustInit($userId = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'PNG':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Milon\Barcode\path|string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->createQrCode($this->getOtpAuthUrl($this->secret, \App\User::getUserModel($this->userId)->getDetail('user_name')), $type);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function verifyCode($secret, $userCode)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Determine whether 2FA is required.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userId = \App\User::getCurrentUserRealId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'HTML':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $qrCodeGenerator->getBarcodeSVG($otpAuthUrl, 'QRCODE');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $qrCodeGenerator->getBarcodeHTML($otpAuthUrl, 'QRCODE');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'TOTP_OPTIONAL':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if 2FA initiation is necessary.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $type - acceptable types [HTML, SVG, PNG]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '<img src="data:image/png;base64,' . $qrCodeGenerator->getBarcodePNG($otpAuthUrl, 'QRCODE', 10, 10) . '" alt="QR code" class="col-auto p-0" />';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int|null $userId - if null then getCurrentUserRealId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
return $this->createQrCode($this->getOtpAuthUrl($this->secret, \App\User::getUserModel($this->userId)->getDetail('user_name')), $type);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $userCode
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('PLL_PASSWORD_2FA' === $userModel->getDetail('login_method') || 'PLL_LDAP_2FA' === $userModel->getDetail('login_method')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $otpAuthUrl
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function isActive($userId = null)
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
if ('PLL_PASSWORD_2FA' === $userModel->getDetail('login_method') || 'PLL_LDAP_2FA' === $userModel->getDetail('login_method')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return empty(\App\User::getUserModel($userId)->getDetail('authy_secret_totp'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws \App\Exceptions\NotAllowedMethod
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private function createQrCode($otpAuthUrl, $type = 'HTML')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int|null $userId - if null then getCurrentUserRealId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $type - acceptable types [HTML, SVG, PNG]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->authenticator->verifyKey($secret, (string) $userCode);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isActive = 'PLL_AUTHY_TOTP' === $userModel->getDetail('authy_methods');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $isActive;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($userId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'SVG':
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
return '<img src="data:image/png;base64,' . $qrCodeGenerator->getBarcodePNG($otpAuthUrl, 'QRCODE', 10, 10) . '" alt="QR code" class="col-auto p-0" />';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 2FA - verification of the code from the user.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* 2FA - get the current one time password.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'TOTP_OBLIGATORY':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->secret = $this->authenticator->generateSecretKey();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create QR code.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create QR code for user.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($userId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qrCodeGenerator = new \Milon\Barcode\DNS2D();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\NotAllowedMethod('LBL_NOT_EXIST: ' . $type);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getCode(): string
- Exclude checks
Class name "Users_Totp_Authmethod" is not in camel caps format Open
class Users_Totp_Authmethod
- Exclude checks