Function getPayerId
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function getPayerId(): string
{
$bbanLength = $this->countryIban->BBANLength();
$conditionsForPayerId = $this->fieldParams['conditions'];
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- 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
The method getPayerId() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. Open
protected function getPayerId(): string
{
$bbanLength = $this->countryIban->BBANLength();
$conditionsForPayerId = $this->fieldParams['conditions'];
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Missing class import via use statement (line '58', column '13'). Open
throw new \App\Exceptions\AppException('ERR_NO_VALUE');
- 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 '33', column '29'). Open
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- 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 '32', column '16'). Open
$iban = new \PHP_IBAN\IBAN();
- 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
Define a constant instead of duplicating this literal "clientId" 4 times. Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- 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.
Add a "case default" clause to this "switch" statement. Open
switch ($clientPattern[$charPosition]) {
- Read upRead up
- Exclude checks
The requirement for a final case default
clause is defensive programming. The clause should either take appropriate action, or contain
a suitable comment as to why no action is taken. Even when the switch
covers all current values of an enum
, a default case
should still be used because there is no guarantee that the enum
won't be extended.
Noncompliant Code Example
switch ($param) { //missing default clause case 0: do_something(); break; case 1: do_something_else(); break; } switch ($param) { default: // default clause should be the last one error(); break; case 0: do_something(); break; case 1: do_something_else(); break; }
Compliant Solution
switch ($param) { case 0: do_something(); break; case 1: do_something_else(); break; default: error(); break; }
See
- MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
- MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
- MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
- MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
- MISRA C:2012, 16.1 - All switch statements shall be well-formed
- MISRA C:2012, 16.4 - Every switch statement shall have a default label
- MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
- MITRE, CWE-478 - Missing Default Case in Switch Statement
- CERT, MSC01-C. - Strive for logical completeness
- CERT, MSC01-CPP. - Strive for logical completeness
Define a constant instead of duplicating this literal "country" 4 times. Open
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- 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.
Define a constant instead of duplicating this literal "sortCode" 4 times. Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- 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.
Call to method __construct
from undeclared class \PHP_IBAN\IBANCountry
Open
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->countryIban
Open
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->recordModel
Open
if ('defaultValue' === $fieldNameForCondition || ($fieldValueForCondition && $fieldValueForCondition === $this->recordModel->get($fieldNameForCondition))) {
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
(Did you mean $fieldParams) Open
$this->fieldParams = $fieldParams;
- Exclude checks
Call to method __construct
from undeclared class \PHP_IBAN\IBAN
Open
$iban = new \PHP_IBAN\IBAN();
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
(Did you mean $fieldParams) Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
Open
if ('random' === $conditionsForPayerId && isset($this->fieldParams['clientIdPattern'])) {
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
(Did you mean $fieldParams) Open
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->recordModel
(Did you mean $recordModel) Open
$this->recordModel = $recordModel;
- Exclude checks
Reference to undeclared property \App\Fields\Iban->countryIban
Open
$countryIbanLength = $this->countryIban->IBANLength();
- Exclude checks
Reference to undeclared property \App\Fields\Iban->recordModel
Open
$valueForPayerId = $this->recordModel->get($fieldFromGetValue);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
(Did you mean $fieldParams) Open
return $this->fieldParams['country'] . $checkSumValue . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
Open
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->countryIban
Open
$bbanLength = $this->countryIban->BBANLength();
- Exclude checks
string
to array comparison Open
if ('random' === $conditionsForPayerId && isset($this->fieldParams['clientIdPattern'])) {
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
Open
if (isset($this->fieldParams['country'], $this->fieldParams['sortCode'], $this->fieldParams['clientId'], $this->fieldParams['conditions'])) {
- Exclude checks
Doc-block of $recordModel
in getIbanValue
contains phpdoc param type \App\Fields\Vtiger_Record_Model
which is incompatible with the param type \Vtiger_Record_Model
declared in the signature Open
* @param Vtiger_Record_Model $recordModel
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
Open
$clientPattern = $this->fieldParams['clientIdPattern'];
- Exclude checks
Call to method FindChecksum
from undeclared class \PHP_IBAN\IBAN
Open
$checkSumValue = $iban->FindChecksum($ibanNumberForCalculateCheckSum);
- Exclude checks
Reference to undeclared property \App\Fields\Iban->fieldParams
Open
$conditionsForPayerId = $this->fieldParams['conditions'];
- Exclude checks
Avoid excessively long variable names like $fieldNameForCondition. Keep variable name length under 20. Open
[$fieldNameForCondition, $fieldFromGetValue, $fieldValueForCondition] = array_pad(explode(':', $conditionValues), 3, false);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $ibanNumberForCalculateCheckSum. Keep variable name length under 20. Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $payerCharactersAmount. Keep variable name length under 20. Open
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $checkSumValueForCreateIban. Keep variable name length under 20. Open
$checkSumValueForCreateIban = '00';
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $fieldValueForCondition. Keep variable name length under 20. Open
[$fieldNameForCondition, $fieldFromGetValue, $fieldValueForCondition] = array_pad(explode(':', $conditionValues), 3, false);
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $payerCharactersAmount. Keep variable name length under 20. Open
protected function addLeadingZeros(int $payerCharactersAmount, string $valueForPayerId): string
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $fieldParams
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel = $recordModel;
- 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
$payerId = $this->getPayerId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->fieldParams['country'] . $checkSumValue . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$valueForPayerId = $this->recordModel->get($fieldFromGetValue);
- 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 str_pad($valueForPayerId, $payerCharactersAmount, '0', STR_PAD_LEFT);
- 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
$checkSumValueForCreateIban = '00';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->fieldParams['country'], $this->fieldParams['sortCode'], $this->fieldParams['clientId'], $this->fieldParams['conditions'])) {
- 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 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
$iban = new \PHP_IBAN\IBAN();
- Exclude checks
Line exceeds 120 characters; contains 183 characters Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- 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
* Create payers id value for IBAN.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_array($conditionsForPayerId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'N':
- 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
$this->fieldParams = $fieldParams;
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
return $this->fieldParams['country'] . $checkSumValue . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- 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 $valueForPayerId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create randomly payer id by pattern.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'A':
- 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->addLeadingZeros($payerCharactersAmount, $valueForPayerId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add leading zeros to payer id if necessary.
- 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
protected function addLeadingZeros(int $payerCharactersAmount, string $valueForPayerId): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'X':
- 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
$this->countryIban = new \PHP_IBAN\IBANCountry($this->fieldParams['country']);
- 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
protected function checkIfFieldHasMandatoryParams(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$bbanLength = $this->countryIban->BBANLength();
- 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
if ((int) $countryIbanLength !== \strlen($ibanNumberForCalculateCheckSum)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Checks if field params has mandatory values.
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($clientPattern[$charPosition]) {
- 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 $payerId;
- 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
$numbers = range('0', '9');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$payerId .= rand(0, 9);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$countryIbanLength = $this->countryIban->IBANLength();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$ibanNumberForCalculateCheckSum = $this->fieldParams['country'] . $checkSumValueForCreateIban . $this->fieldParams['sortCode'] . $this->fieldParams['clientId'] . $payerId;
- 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\AppException
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
if ('defaultValue' === $fieldNameForCondition || ($fieldValueForCondition && $fieldValueForCondition === $this->recordModel->get($fieldNameForCondition))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $payerCharactersAmount
- 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
$payerId = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$payerId .= $letters[$randomKey];
- 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
$checkSumValue = $iban->FindChecksum($ibanNumberForCalculateCheckSum);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($conditionsForPayerId as $conditionValues) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($valueForPayerId && \strlen($valueForPayerId) !== $payerCharactersAmount) {
- 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
$lettersAndNumbers = array_merge($letters, $numbers);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$payerId .= $lettersAndNumbers[$randomKey];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Vtiger_Record_Model $recordModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getIbanValue(array $fieldParams, \Vtiger_Record_Model $recordModel): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$conditionsForPayerId = $this->fieldParams['conditions'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('random' === $conditionsForPayerId && isset($this->fieldParams['clientIdPattern'])) {
- 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
protected function createRandomPayerId(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$clientPattern = $this->fieldParams['clientIdPattern'];
- 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
if ($this->checkIfFieldHasMandatoryParams()) {
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
[$fieldNameForCondition, $fieldFromGetValue, $fieldValueForCondition] = array_pad(explode(':', $conditionValues), 3, false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('defaultValue' === $fieldNameForCondition || ($fieldValueForCondition && $fieldValueForCondition === $this->recordModel->get($fieldNameForCondition))) {
- 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
$letters = range('A', 'Z');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function returns IBAN value.
- 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
$randomKey = array_rand($letters, 1);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 149 characters Open
if (isset($this->fieldParams['country'], $this->fieldParams['sortCode'], $this->fieldParams['clientId'], $this->fieldParams['conditions'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$payerCharactersAmount = $bbanLength - \strlen($this->fieldParams['sortCode']) - \strlen($this->fieldParams['clientId']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[$fieldNameForCondition, $fieldFromGetValue, $fieldValueForCondition] = array_pad(explode(':', $conditionValues), 3, false);
- 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
$patternLength = \strlen($clientPattern);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
for ($charPosition = 0; $charPosition < $patternLength; ++$charPosition) {
- 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
throw new \App\Exceptions\AppException('ERR_NO_VALUE');
- 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
protected function getPayerId(): 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->createRandomPayerId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$randomKey = array_rand($letters, 1);
- Exclude checks