YetiForceCompany/YetiForceCRM

View on GitHub
app/Integrations/Wapro/Synchronizer.php

Summary

Maintainability
A
3 hrs
Test Coverage
F
0%

Function loadFromFieldMap has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    protected function loadFromFieldMap(): void
    {
        foreach ($this->fieldMap as $wapro => $crm) {
            if (\array_key_exists($wapro, $this->row)) {
                if (null === $this->row[$wapro]) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer.php - About 2 hrs to fix

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 convertUnitName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convertUnitName(string $value, array $params): string
    {
        $value = trim($value, '.');
        $picklistValues = \App\Fields\Picklist::getValuesName($params['fieldName']);
        $return = \in_array($value, $picklistValues);
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer.php - About 35 mins to fix

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 getGlobalTax has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getGlobalTax(string $value, bool $addIfNotExist = false): string
    {
        $value = (float) $value;
        $taxes = '';
        foreach (\Vtiger_Inventory_Model::getGlobalTaxes() as $key => $tax) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer.php - About 25 mins to fix

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 class Synchronizer has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13.
Open

abstract class Synchronizer
{
    /** @var string Provider name | File name. */
    const NAME = null;

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Missing class import via use statement (line '108', column '17').
Open

        $crmId = (new \App\Db\Query())->select(['crmid'])->from(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)->where(['wtable' => $table, 'wid' => $id])->scalar();

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 '258', column '17').
Open

        $wapro = (new \App\Db\Query())->from('dbo.WALUTA_BAZOWA_V')->one($this->controller->getDb());

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 '310', column '20').
Open

            $taxModel = new \Settings_Inventory_Record_Model();

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

The method getGlobalTax has a boolean flag argument $addIfNotExist, which is a certain sign of a Single Responsibility Principle violation.
Open

    protected function getGlobalTax(string $value, bool $addIfNotExist = false): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Avoid using static access to class '\App\Cache' in method 'findInMapTable'.
Open

        if (\App\Cache::has('WaproMapTable', $cacheKey)) {

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\Language' in method 'convertUnitName'.
Open

                if (\App\Language::translate($picklistValue, $params['moduleName']) === $value) {

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\Fields\Currency' in method 'convertCurrency'.
Open

            $currencyId = \App\Fields\Currency::addCurrency($value);

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 loadFromFieldMap uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $this->recordModel->set($crm, trim($this->row[$wapro]));
                }

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 'findInMapTable'.
Open

        \App\Cache::save('WaproMapTable', $cacheKey, $crmId);

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_Inventory_Model' in method 'getGlobalTax'.
Open

        foreach (\Vtiger_Inventory_Model::getGlobalTaxes() as $key => $tax) {

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\Fields\Picklist' in method 'convertUnitName'.
Open

        $picklistValues = \App\Fields\Picklist::getValuesName($params['fieldName']);

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\Log' in method 'loadFromFieldMap'.
Open

                \App\Log::error("No column {$wapro} in the {$this->className}", 'Integrations/Wapro');

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\TextUtils' in method 'logError'.
Open

                'trace' => \App\TextUtils::textTruncate("WAPRO ID: {$this->waproId} \n{$ex->__toString()}", 65535)

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 '188', column '7').
Open

    protected function convertPhone(string $value, array &$params): string
    {
        if ($fieldModel = $this->recordModel->getField($params['fieldName'])) {
            $details = $fieldModel->getUITypeModel()->getPhoneDetails($value, 'PL');
            $value = $details['number'];

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 assigning values to variables in if clauses and the like (line '239', column '7').
Open

    protected function findRelationship(string $value, array $params): int
    {
        if ($id = $this->findInMapTable($value, $params['tableName'])) {
            return $id;
        }

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 '\App\Log' in method 'logError'.
Open

        \App\Log::error("Error during import record in {$this->className}:\n{$ex->__toString()}", 'Integrations/Wapro');

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\TextUtils' in method 'logError'.
Open

                'message' => \App\TextUtils::textTruncate($ex->getMessage(), 255),

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\Purifier' in method 'decode'.
Open

        return trim(preg_replace('/[\x{0081}\n]/u', ' ', \App\Purifier::decodeHtml($value)));

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\TextUtils' in method 'log'.
Open

                'message' => \App\TextUtils::textTruncate($message, 255),

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\Fields\Country' in method 'convertCountry'.
Open

        return $value ? \App\Fields\Country::getCountryName($value) : null;

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\Fields\Currency' in method 'getBaseCurrency'.
Open

            'default' => \App\Fields\Currency::getDefault(),

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\Validator' in method 'getGlobalTax'.
Open

            if (\App\Validator::floatIsEqual($tax['value'], $value)) {

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\Cache' in method 'findInMapTable'.
Open

            return \App\Cache::get('WaproMapTable', $cacheKey);

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 loadFromFieldMap uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                \App\Log::error("No column {$wapro} in the {$this->className}", 'Integrations/Wapro');
            }

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\Fields\Currency' in method 'convertCurrency'.
Open

        $currencyId = \App\Fields\Currency::getIdByCode($value);

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 "WaproMapTable" 3 times.
Open

        if (\App\Cache::has('WaproMapTable', $cacheKey)) {

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.

Remove the unused function parameter "$params".
Open

    protected function convertCountry(string $value, array $params = []): ?string

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Remove the unused function parameter "$params".
Open

    protected function convertCurrency(string $value, array $params): int

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Remove the unused function parameter "$params".
Open

    protected function decode(string $value, array $params): string

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Define a constant instead of duplicating this literal "fieldName" 7 times.
Open

                    $this->recordModel->set($crm['fieldName'], trim($value));

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 convertCurrency(string $value, array $params): int

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

Avoid unused parameters such as '$params'.
Open

    protected function convertCountry(string $value, array $params = []): ?string

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

Avoid unused parameters such as '$params'.
Open

    protected function decode(string $value, array $params): string

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

Assigning array{wapro:mixed,currencyId:int,default:array|bool} to property but \App\Integrations\Wapro\Synchronizer::$currency is bool
Open

        return self::$currency = [

Call to undeclared method \App\Db::createCommand
Open

        \App\DB::getInstance('log')->createCommand()
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Call to method floatIsEqual from undeclared class \App\Validator (Did you mean class \Tests\App\Validator)
Open

            if (\App\Validator::floatIsEqual($tax['value'], $value)) {
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Argument 1 (id) is string but \App\Integrations\Wapro\Synchronizer::findInMapTable() takes int defined at /code/app/Integrations/Wapro/Synchronizer.php:102
Open

        if ($id = $this->findInMapTable($value, $params['tableName'])) {

Call to method error from undeclared class \App\Log
Open

        \App\Log::error("Error during import record in {$this->className}:\n{$ex->__toString()}", 'Integrations/Wapro');
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Call to undeclared method \App\Db::createCommand
Open

        \App\DB::getInstance('log')->createCommand()
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Call to undeclared method \Vtiger_Base_UIType::getPhoneDetails
Open

            $details = $fieldModel->getUITypeModel()->getPhoneDetails($value, 'PL');
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Call to undeclared method \App\Db\Query::from
Open

        $wapro = (new \App\Db\Query())->from('dbo.WALUTA_BAZOWA_V')->one($this->controller->getDb());
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Returning type bool but getBaseCurrency() is declared to return array
Open

            return self::$currency;

Call to undeclared method \App\Db\Query::select
Open

        $crmId = (new \App\Db\Query())->select(['crmid'])->from(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)->where(['wtable' => $table, 'wid' => $id])->scalar();
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Call to method error from undeclared class \App\Log
Open

                \App\Log::error("No column {$wapro} in the {$this->className}", 'Integrations/Wapro');
Severity: Critical
Found in app/Integrations/Wapro/Synchronizer.php by phan

Avoid variables with short names like $ex. Configured minimum length is 3.
Open

    public function logError(\Throwable $ex): void

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

    public function findInMapTable(int $id, string $table): ?int

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($value, $params['tableName'])) {

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

        $this->className = substr(static::class, strrpos(static::class, '\\') + 1);

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function process(): int;

Spaces must be used to indent lines; tabs are not allowed
Open

     * Find the crm ID for the integration record.

Spaces must be used to indent lines; tabs are not allowed
Open

            ->insert(\App\Integrations\Wapro::LOG_TABLE_NAME, [

Spaces must be used to indent lines; tabs are not allowed
Open

                'trace' => \App\TextUtils::textTruncate("WAPRO ID: {$this->waproId} \n{$ex->__toString()}", 65535)

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\DB::getInstance('log')->createCommand()

Spaces must be used to indent lines; tabs are not allowed
Open

            if (\array_key_exists($wapro, $this->row)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var bool Information on currency configuration. */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \App\Integrations\Wapro $controller

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get number of records.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param int    $id

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

                    continue;

Spaces must be used to indent lines; tabs are not allowed
Open

                    if ($this->skip) {

Spaces must be used to indent lines; tabs are not allowed
Open

    protected static $currency;

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $cacheKey = "$id|$table";

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function log(string $message): void

Spaces must be used to indent lines; tabs are not allowed
Open

                'error' => false,

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int|null

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\DB::getInstance('log')->createCommand()

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * Function to get provider name.

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $crmId = (new \App\Db\Query())->select(['crmid'])->from(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)->where(['wtable' => $table, 'wid' => $id])->scalar();

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \Throwable $ex

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                } else {

Spaces must be used to indent lines; tabs are not allowed
Open

                }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Synchronizer constructor.

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->fieldMap = $controller->customConfig[$this->className];

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $table

Spaces must be used to indent lines; tabs are not allowed
Open

            return \App\Cache::get('WaproMapTable', $cacheKey);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void

Spaces must be used to indent lines; tabs are not allowed
Open

                }

Spaces must be used to indent lines; tabs are not allowed
Open

    public function __construct(\App\Integrations\Wapro $controller)

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

    public function getName(): string

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Line exceeds 120 characters; contains 166 characters
Open

        $crmId = (new \App\Db\Query())->select(['crmid'])->from(\App\Integrations\Wapro::RECORDS_MAP_TABLE_NAME)->where(['wtable' => $table, 'wid' => $id])->scalar();

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                'message' => \App\TextUtils::textTruncate($ex->getMessage(), 255),

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                'time' => date('Y-m-d H:i:s'),

Spaces must be used to indent lines; tabs are not allowed
Open

     * Load data from DB based on field map.

Spaces must be used to indent lines; tabs are not allowed
Open

                if (\is_array($crm)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $fieldMap = [];

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var \Vtiger_Record_Model Record model instance. */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $recordModel;

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Main function to execute synchronizer.

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Log::error("Error during import record in {$this->className}:\n{$ex->__toString()}", 'Integrations/Wapro');

Spaces must be used to indent lines; tabs are not allowed
Open

                'message' => \App\TextUtils::textTruncate($message, 255),

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach ($this->fieldMap as $wapro => $crm) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string Class name. */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var array Record row. */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return void

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            ])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string Priority order. */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string[] Map of fields integrating with WAPRO ERP */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $waproId;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function importRecord(): int;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                'category' => $this->className,

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $message

Spaces must be used to indent lines; tabs are not allowed
Open

                \App\Log::error("No column {$wapro} in the {$this->className}", 'Integrations/Wapro');

Spaces must be used to indent lines; tabs are not allowed
Open

    abstract public function getCounter(): int;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Cache::save('WaproMapTable', $cacheKey, $crmId);

Spaces must be used to indent lines; tabs are not allowed
Open

     * Add log to db.

Spaces must be used to indent lines; tabs are not allowed
Open

            ->insert(\App\Integrations\Wapro::LOG_TABLE_NAME, [

Line exceeds 120 characters; contains 135 characters
Open

                    $value = $this->{$crm['fn']}($this->row[$wapro], $crm); // it cannot be on the lower line because it is a reference

Spaces must be used to indent lines; tabs are not allowed
Open

    public $className;

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $controller;

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string provider name

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function loadFromFieldMap(): void

Spaces must be used to indent lines; tabs are not allowed
Open

                    $this->recordModel->set($crm, trim($this->row[$wapro]));

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var string Provider name | File name. */

Spaces must be used to indent lines; tabs are not allowed
Open

    const NAME = null;

Spaces must be used to indent lines; tabs are not allowed
Open

    const SEQUENCE = null;

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var bool The flag to skip record creation. */

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $skip;

Spaces must be used to indent lines; tabs are not allowed
Open

     * Import record.

Spaces must be used to indent lines; tabs are not allowed
Open

        return $this::NAME;

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Add error log to db.

Spaces must be used to indent lines; tabs are not allowed
Open

                    $value = $this->{$crm['fn']}($this->row[$wapro], $crm); // it cannot be on the lower line because it is a reference

Spaces must be used to indent lines; tabs are not allowed
Open

                    $this->recordModel->set($crm['fieldName'], trim($value));

Spaces must be used to indent lines; tabs are not allowed
Open

            } else {

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var int WAPRO ERP record ID. */

Spaces must be used to indent lines; tabs are not allowed
Open

        if (isset($controller->customConfig[$this->className])) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    public function logError(\Throwable $ex): void

Spaces must be used to indent lines; tabs are not allowed
Open

                'error' => true,

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

                    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert phone to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

            $details = $fieldModel->getUITypeModel()->getPhoneDetails($value, 'PL');

Spaces must be used to indent lines; tabs are not allowed
Open

                $params['fieldName'] = $details['fieldName'];

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string|null

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        if (empty($currencyId)) {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        if (isset(self::$currency)) {

Spaces must be used to indent lines; tabs are not allowed
Open

            'wapro' => $wapro,

Spaces must be used to indent lines; tabs are not allowed
Open

            'default' => \App\Fields\Currency::getDefault(),

Spaces must be used to indent lines; tabs are not allowed
Open

        ];

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

                    break;

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param bool   $addIfNotExist

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function getGlobalTax(string $value, bool $addIfNotExist = false): string

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            if (\App\Validator::floatIsEqual($tax['value'], $value)) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        return $value ? \App\Fields\Country::getCountryName($value) : null;

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function findRelationship(string $value, array $params): int

Spaces must be used to indent lines; tabs are not allowed
Open

        return 0;

Spaces must be used to indent lines; tabs are not allowed
Open

            return self::$currency;

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            $taxModel = new \Settings_Inventory_Record_Model();

Spaces must be used to indent lines; tabs are not allowed
Open

                'default' => 0,

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function convertCountry(string $value, array $params = []): ?string

Spaces must be used to indent lines; tabs are not allowed
Open

        $value = trim($value, '.');

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get global tax from value.

Spaces must be used to indent lines; tabs are not allowed
Open

                ->setType('Taxes');

Spaces must be used to indent lines; tabs are not allowed
Open

    protected $row;

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    public function findInMapTable(int $id, string $table): ?int

Spaces must be used to indent lines; tabs are not allowed
Open

                'time' => date('Y-m-d H:i:s'),

Spaces must be used to indent lines; tabs are not allowed
Open

                'category' => $this->className,

Spaces must be used to indent lines; tabs are not allowed
Open

                if (null === $this->row[$wapro]) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function convertPhone(string $value, array &$params): string

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function getBaseCurrency(): array

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                    $value = $picklistValue;

Spaces must be used to indent lines; tabs are not allowed
Open

            $taxModel->setData([

Spaces must be used to indent lines; tabs are not allowed
Open

        return $value;

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!$return) {

Spaces must be used to indent lines; tabs are not allowed
Open

            ])

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($fieldModel = $this->recordModel->getField($params['fieldName'])) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert country to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert currency to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

            $value = $details['number'];

Spaces must be used to indent lines; tabs are not allowed
Open

            $currencyId = \App\Fields\Currency::addCurrency($value);

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        return $currencyId ?? 0;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

        $picklistValues = \App\Fields\Picklist::getValuesName($params['fieldName']);

Spaces must be used to indent lines; tabs are not allowed
Open

            $this->skip = true;

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $return = \in_array($value, $picklistValues);

Spaces must be used to indent lines; tabs are not allowed
Open

     * Get information about base currency.

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

                    $return = true;

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

                'value' => $value,

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function convertUnitName(string $value, array $params): string

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return int

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

        return $taxes;

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $currencyId = \App\Fields\Currency::getIdByCode($value);

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return array

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                break;

Spaces must be used to indent lines; tabs are not allowed
Open

            $taxes = $taxModel->save();

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

        $value = trim($value);

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert unit name to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach (\Vtiger_Inventory_Model::getGlobalTaxes() as $key => $tax) {

Spaces must be used to indent lines; tabs are not allowed
Open

                'status' => 0,

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

            if ($params['fieldName'] !== $details['fieldName']) {

Spaces must be used to indent lines; tabs are not allowed
Open

        if (!empty($params['skipMode'])) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        return self::$currency = [

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function convertCurrency(string $value, array $params): int

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            return $id;

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

            }

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            foreach ($picklistValues as $picklistValue) {

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

                }

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert unit name to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

        }

Spaces must be used to indent lines; tabs are not allowed
Open

    /** @var \App\Integrations\Wapro Controller instance. */

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        $this->controller = $controller;

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        if (\App\Cache::has('WaproMapTable', $cacheKey)) {

Spaces must be used to indent lines; tabs are not allowed
Open

        return $crmId ?: null;

Spaces must be used to indent lines; tabs are not allowed
Open

            ])->execute();

Spaces must be used to indent lines; tabs are not allowed
Open

                        break;

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

        $wapro = (new \App\Db\Query())->from('dbo.WALUTA_BAZOWA_V')->one($this->controller->getDb());

Spaces must be used to indent lines; tabs are not allowed
Open

        return $return ? $value : '';

Spaces must be used to indent lines; tabs are not allowed
Open

                $taxes = $key;

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($addIfNotExist && empty($taxes)) {

Spaces must be used to indent lines; tabs are not allowed
Open

                'name' => $value,

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return string

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param string $value

Spaces must be used to indent lines; tabs are not allowed
Open

     * Convert currency to system format.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        if ($id = $this->findInMapTable($value, $params['tableName'])) {

Spaces must be used to indent lines; tabs are not allowed
Open

            'currencyId' => $this->convertCurrency($wapro['SYM_WALUTY'], []),

Spaces must be used to indent lines; tabs are not allowed
Open

                if (\App\Language::translate($picklistValue, $params['moduleName']) === $value) {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        $value = (float) $value;

Spaces must be used to indent lines; tabs are not allowed
Open

        $taxes = '';

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param array  $params

Spaces must be used to indent lines; tabs are not allowed
Open

    protected function decode(string $value, array $params): string

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

        return trim(preg_replace('/[\x{0081}\n]/u', ' ', \App\Purifier::decodeHtml($value)));

Spaces must be used to indent lines; tabs are not allowed
Open

    {

There are no issues that match your filters.

Category
Status