The class Invoice has an overall complexity of 51 which is very high. The configured complexity threshold is 50. Open
class Invoice extends \App\Integrations\Wapro\Synchronizer
{
/** {@inheritdoc} */
const NAME = 'LBL_INVOICE';
- Exclude checks
Function loadInventory
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function loadInventory(): void
{
$inventory = $this->getInventory();
if (!$this->recordModel->isNew()) {
$oldInventory = $this->recordModel->getInventoryData();
- 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
Function process
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function process(): int
{
$query = (new \App\Db\Query())->select([
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- 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
Method process
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(): int
{
$query = (new \App\Db\Query())->select([
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
Method getInventory
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getInventory(): array
{
$currencyId = $this->getBaseCurrency()['currencyId'];
if (!empty($this->row['DOK_WAL'])) {
$currencyId = $this->convertCurrency($this->row['SYM_WAL'], []);
Function getCurrencyParam
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getCurrencyParam(int $currencyId): array
{
$baseCurrency = $this->getBaseCurrency();
$defaultCurrencyId = $baseCurrency['default']['id'];
if (!empty($this->row['DATA_KURS_WAL'])) {
- 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 loadInventory() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
protected function loadInventory(): void
{
$inventory = $this->getInventory();
if (!$this->recordModel->isNew()) {
$oldInventory = $this->recordModel->getInventoryData();
- 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
The method process() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10. Open
public function process(): int
{
$query = (new \App\Db\Query())->select([
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- 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
Refactor this function to reduce its Cognitive Complexity from 25 to the 15 allowed. Open
protected function loadInventory(): void
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Missing class import via use statement (line '239', column '22'). Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- 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 '49', column '17'). Open
$query = (new \App\Db\Query())->select([
- 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 '329', column '15'). Open
return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());
- 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 '174', column '15'). Open
$row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')
- 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\Record' in method 'loadInventory'. Open
$this->recordModel->set('subject', \App\Record::getLabel($inventory[0]['name'], true) ?: '-');
- 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\Pauser' in method 'process'. Open
$pauser = \App\Pauser::getInstance('WaproInvoiceLastId');
- 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\Json' in method 'getInventory'. Open
$currencyParam = \App\Json::encode($this->getCurrencyParam($currencyId));
- 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 assigning values to variables in if clauses and the like (line '59', column '7'). Open
public function process(): int
{
$query = (new \App\Db\Query())->select([
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\vtlib\Functions' in method 'getCurrencyParam'. Open
$date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));
- 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 '\Vtiger_Record_Model' in method 'importRecord'. Open
$this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');
- 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\Json' in method 'getInventory'. Open
'discountparam' => \App\Json::encode([
'aggregationType' => ['individual', 'additional'],
'individualDiscount' => empty((float) $row['RABAT']) ? 0 : (-$row['RABAT']),
'individualDiscountType' => 'percentage',
'additionalDiscount' => empty((float) $row['RABAT2']) ? 0 : (-$row['RABAT2']),
- 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
The method getCurrencyParam uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Json' in method 'getInventory'. Open
'taxparam' => \App\Json::encode(
$this->getGlobalTax($row['KOD_VAT']) ? [
'aggregationType' => 'global',
'globalTax' => (float) $row['KOD_VAT'],
] : [
- 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 assigning values to variables in if clauses and the like (line '103', column '7'). Open
public function importRecord(): int
{
if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {
$this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');
} else {
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method importRecord uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
$this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [
'wtable' => 'DOKUMENT_HANDLOWY',
]]);
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
The method getCurrencyParam uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$info['value'] = round($this->row['PRZELICZNIK_WAL'], 5);
$info['conversion'] = round(1 / $this->row['PRZELICZNIK_WAL'], 5);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Avoid using static access to class '\App\Cache' in method 'importRecord'. Open
\App\Cache::save('WaproMapTable', "{$this->waproId}|DOKUMENT_HANDLOWY", $this->recordModel->getId());
- 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 '\Vtiger_Record_Model' in method 'importRecord'. Open
$this->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
- 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 "aggregationType" 3 times. Open
'aggregationType' => ['individual', 'additional'],
- 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 "ID_DOKUMENTU_HANDLOWEGO" 3 times. Open
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
- 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 "fieldName" 11 times. Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- 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 "DOK_WAL" 3 times. Open
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- 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.
Move this "case default" clause to the end of this "switch" statement. Open
default:
- 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 "convertDate" 3 times. Open
'issueTime' => ['fieldName' => 'issue_time', 'fn' => 'convertDate'],
- 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 "PRZELICZNIK_WAL" 3 times. Open
if (empty($this->row['PRZELICZNIK_WAL'])) {
- 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 "value" 3 times. Open
$defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.0],
- 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 "saleDate" 3 times. Open
'saleDate' => ['fieldName' => 'saledate', 'fn' => 'convertDate'],
- 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 "KOD_VAT" 4 times. Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- 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 "ID_ARTYKULU" 3 times. Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- 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 "RABAT2" 3 times. Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- 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 "conversion" 3 times. Open
$defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.0],
- 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 "RABAT" 3 times. Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- 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 "tableName" 3 times. Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- 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.
Avoid unused parameters such as '$params'. Open
protected function convertDate(string $value, array $params): string
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Call to undeclared method \App\Db\Query::from
Open
return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());
- Exclude checks
Argument 1 (from)
is int
but \Settings_CurrencyUpdate_Module_Model::getCRMConversionRate()
takes string
defined at /code/modules/Settings/CurrencyUpdate/models/Module.php:274
Open
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
- Exclude checks
Call to undeclared method \App\Integrations\Wapro\Synchronizer::importRecordById
Open
return $this->controller->getSynchronizer('Products')->importRecordById($id);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')
- Exclude checks
Argument 1 (value)
is int
but \App\Pauser::setValue()
takes string
defined at /code/app/Pauser.php:77
Open
$pauser->setValue($lastId);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())->select([
- Exclude checks
Avoid variables with short names like $u. Configured minimum length is 3. Open
$lastId = $s = $e = $i = $u = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $i. Configured minimum length is 3. Open
$lastId = $s = $e = $i = $u = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
protected function addProduct(int $id): int
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $s. Configured minimum length is 3. Open
$lastId = $s = $e = $i = $u = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $e. Configured minimum length is 3. Open
$lastId = $s = $e = $i = $u = 0;
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $id. Configured minimum length is 3. Open
if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used to indent lines; tabs are not allowed Open
'paymentDate' => ['fieldName' => 'paymentdate', 'fn' => 'convertDate'],
- 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
$lastId = $s = $e = $i = $u = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->waproId = $row['ID_DOKUMENTU_HANDLOWEGO'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->row = $row;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($this->importRecord()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$s;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$i;
- 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
$this->logError($th);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'wtable' => 'DOKUMENT_HANDLOWY',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->loadInventory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 2;
- 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
/** @var string[] Map for payment methods with WAPRO ERP */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
'ID_KONTRAHENTA' => ['fieldName' => 'accountid', 'fn' => 'findRelationship', 'tableName' => 'KONTRAHENT', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'FORMA_PLATNOSCI' => ['fieldName' => 'payment_methods', 'fn' => 'convertPaymentMethods'],
- 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
$this->recordModel->setDataForSave([\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save('WaproMapTable', "{$this->waproId}|DOKUMENT_HANDLOWY", $this->recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const SEQUENCE = 5;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'gotówka' => 'PLL_CASH',
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- 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
* Convert payment method to system format.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset(self::PAYMENT_METHODS_MAP[$value])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::PAYMENT_METHODS_MAP[$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
return $key ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'czek' => 'PLL_CHECK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($rows as $row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastId = $this->waproId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel = \Vtiger_Record_Model::getInstanceById($id, 'FInvoice');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('finvoice_status', 'PLL_UNASSIGNED');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->loadFromFieldMap();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currencyDate' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_KURS_WAL - 36163 as datetime)',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->from('dbo.DOKUMENT_HANDLOWY')
- 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
case 2:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 == $lastId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function importRecord(): int
- 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->recordModel->set('wapro_id', $this->waproId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->loadDeliveryAddress('b');
- 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
$key = $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
$pauser = \App\Pauser::getInstance('WaproInvoiceLastId');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $i + $u;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $this->recordModel->getField($params['fieldName']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ID_FIRMY' => ['fieldName' => 'multiCompanyId', 'fn' => 'findRelationship', 'tableName' => 'FIRMA', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'saleDate' => ['fieldName' => 'saledate', 'fn' => 'convertDate'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 0:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const PAYMENT_METHODS_MAP = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $fieldMap = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'KONTRAHENT_NAZWA' => ['fieldName' => 'company_name_a', 'fn' => 'decode'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->select([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pauser->destroy();
- 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->recordModel = \Vtiger_Record_Model::getCleanInstance('FInvoice');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = array_search(mb_strtolower($value), array_map('mb_strtolower', $fieldModel->getPicklistValues()));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($key)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'issueTime' => ['fieldName' => 'issue_time', 'fn' => 'convertDate'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->controller->cron && $this->controller->cron->checkTimeout()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('finvoice_type', 'PLL_DOMESTIC_INVOICE');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'pobranie' => 'PLL_CASH_ON_DELIVERY',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 1:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} catch (\Throwable $th) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$e;
- 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
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
'issueTime' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_WYSTAWIENIA - 36163 as datetime)',
- 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 convertPaymentMethods(string $value, array $params): 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
'ID_KONTRAHENTA' => ['fieldName' => 'accountid', 'fn' => 'findRelationship', 'tableName' => 'KONTRAHENT', 'skipMode' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pauser->setValue($lastId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($id = $this->findInMapTable($this->waproId, 'DOKUMENT_HANDLOWY')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $params
- 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
'przelew' => 'PLL_TRANSFER',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($query->batch(100, $this->controller->getDb()) as $rows) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lastId = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->skip = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 0;
- 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
$fieldModel->setPicklistValues([$value]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['ID_TYPU' => 1]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query->andWhere(['>', 'ID_DOKUMENTU_HANDLOWEGO', $val]);
- 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
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->recordModel->set($this->recordModel->getModule()->getSequenceNumberFieldName(), $this->row['NUMER']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->recordModel->getPreviousValue() ? 1 : 3;
- 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
const NAME = 'LBL_INVOICE';
- Exclude checks
Line exceeds 120 characters; contains 157 characters Open
'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'saleDate' => 'cast (dbo.DOKUMENT_HANDLOWY.DATA_SPRZEDAZY - 36163 as datetime)',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'paymentDate' => 'cast (dbo.DOKUMENT_HANDLOWY.TERMIN_PLAT - 36163 as datetime)',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($val = $pauser->getValue()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
++$u;
- 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
if ($this->skip) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = explode(' ', $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
}
- 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
$oldInventory = $this->recordModel->getInventoryData();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($inventory[0]['name'])) {
- 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
'UWAGI' => 'description',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->log("Create {$i} | Update {$u} | Skipped {$s} | Error {$e}");
- 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
* Convert date to system format.
- 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
$this->recordModel->set('addresslevel5' . $key, $row['MIEJSCOWOSC']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('addresslevel7' . $key, $row['KOD_POCZTOWY']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$same = 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
* Get inventory items.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$currencyId = $this->getBaseCurrency()['currencyId'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'comment1' => trim($row['OPIS']),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'unit' => $this->convertUnitName($row['JEDNOSTKA'], ['fieldName' => 'usageunit', 'moduleName' => 'Products']),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$baseCurrency = $this->getBaseCurrency();
- 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
$this->recordModel->set('company_name_' . $key, $row['FIRMA']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function getInventory(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$productId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$productId = $this->addProduct($row['ID_ARTYKULU']);
- 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
$defaultCurrencyId = $baseCurrency['default']['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
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('last_name_' . $key, $lastName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$same = isset($oldItem[$name]) && $value == $oldItem[$name];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory[$seq] = $oldItem;
- 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
'price' => $this->row['DOK_WAL'] ? $row['CENA_NETTO_WAL'] : $row['CENA_NETTO'],
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
'unit' => $this->convertUnitName($row['JEDNOSTKA'], ['fieldName' => 'usageunit', 'moduleName' => 'Products']),
- 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
'currencyparam' => $currencyParam,
- 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 getCurrencyParam(int $currencyId): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- 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
$row = (new \App\Db\Query())->select(['dbo.MIEJSCE_DOSTAWY.*'])->from('dbo.DOSTAWA')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one($this->controller->getDb());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = ['fieldName' => 'phone_' . $key];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function loadInventory(): void
- 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
'discountmode' => 1,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'additionalDiscount' => empty((float) $row['RABAT2']) ? 0 : (-$row['RABAT2']),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'taxparam' => \App\Json::encode(
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['dbo.DOSTAWA.ID_DOKUMENTU_HANDLOWEGO' => $this->row['DOK_KOREKTY'] ? $this->row['ID_DOK_ORYGINALNEGO'] : $this->waproId])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($inventory as $seq => $item) {
- 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->recordModel->set('subject', \App\Record::getLabel($inventory[0]['name'], 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
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'individualDiscountType' => 'percentage',
- 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 $inventory;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('addresslevel1' . $key, $this->convertCountry($row['SYM_KRAJU']));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory = $this->getInventory();
- 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 array
- 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 addProduct(int $id): int
- 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 getCounter(): int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Load delivery address.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected function loadDeliveryAddress(string $key): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set($params['fieldName'], $phone);
- 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
'aggregationType' => ['individual', 'additional'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'aggregationType' => 'global',
- 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
$info['value'] = round($this->row['PRZELICZNIK_WAL'], 5);
- 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 ($same) {
- 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
'taxmode' => 1,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $params
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $key
- 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
$this->recordModel->set('addresslevel8' . $key, $row['ULICA_LOKAL']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($row['ODBIORCA']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->recordModel->set('first_name_' . $key, $firstName);
- 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
$phone = $this->convertPhone($row['TEL'], $params);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($item as $name => $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
if ($same && $oldItem) {
- 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
$this->recordModel->initInventoryData($inventory);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('dbo.POZYCJA_DOKUMENTU_MAGAZYNOWEGO')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$productId = $this->findRelationship($row['ID_ARTYKULU'], ['tableName' => 'ARTYKUL']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($this->row['DATA_KURS_WAL'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory[] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add a product when it does not exist in CRM.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => $productId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->getGlobalTax($row['KOD_VAT']) ? [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'globalTax' => (float) $row['KOD_VAT'],
- 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
'discount_aggreg' => 2,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = \Settings_CurrencyUpdate_Module_Model::getCleanInstance()->getCRMConversionRate($currencyId, $defaultCurrencyId, $date);
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
return (new \App\Db\Query())->from('dbo.DOKUMENT_HANDLOWY')->where(['ID_TYPU' => 1])->count('*', $this->controller->getDb());
- 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 142 characters Open
->where(['dbo.DOSTAWA.ID_DOKUMENTU_HANDLOWEGO' => $this->row['DOK_KOREKTY'] ? $this->row['ID_DOK_ORYGINALNEGO'] : $this->waproId])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->recordModel->isNew()) {
- 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
$currencyId = $this->convertCurrency($this->row['SYM_WAL'], []);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->createCommand($this->controller->getDb())->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventory = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'individualDiscount' => empty((float) $row['RABAT']) ? 0 : (-$row['RABAT']),
- 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
$info['conversion'] = empty($value) ? 1.0 : round(1 / $value, 5);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $params;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info['value'] = empty($value) ? 1.0 : round($value, 5);
- 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
$info['conversion'] = round(1 / $this->row['PRZELICZNIK_WAL'], 5);
- 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 int
- 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 int $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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $value[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue 2;
- 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
$currencyParam = \App\Json::encode($this->getCurrencyParam($currencyId));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$date = $this->convertDate($this->row['currencyDate'], []);
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params[$currencyId] = $info;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->controller->getSynchronizer('Products')->importRecordById($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
}
- 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
* Load inventory items.
- Exclude checks
Line exceeds 120 characters; contains 161 characters Open
$dataReader = (new \App\Db\Query())->select(['ID_ARTYKULU', 'ILOSC', 'KOD_VAT', 'CENA_NETTO', 'JEDNOSTKA', 'OPIS', 'RABAT', 'RABAT2', 'CENA_NETTO_WAL'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'aggregationType' => 'individual',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$date = \vtlib\Functions::getLastWorkingDay(date('Y-m-d', strtotime('-1 day', strtotime($this->row['saleDate']))));
- 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 convertDate(string $value, array $params): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
[$firstName, $lastName] = explode(' ', $row['ODBIORCA'], 2);
- 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
foreach ($oldInventory as $oldSeq => $oldItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($oldInventory[$oldSeq]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($this->row['DOK_WAL'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['ID_DOK_HANDLOWEGO' => $this->waproId])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'qty' => $row['ILOSC'],
- 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
->leftJoin('dbo.MIEJSCE_DOSTAWY', 'dbo.DOSTAWA.ID_MIEJSCA_DOSTAWY = dbo.MIEJSCE_DOSTAWY.ID_MIEJSCA_DOSTAWY')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'discountparam' => \App\Json::encode([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'individualTax' => (float) $row['KOD_VAT'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currency' => $currencyId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get currency param.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $currencyId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$defaultCurrencyId => ['date' => $date, 'value' => 1.0, 'conversion' => 1.0],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$info = ['date' => $date];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($currencyId != $defaultCurrencyId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- 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($this->row['PRZELICZNIK_WAL'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks