YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/PBX/models/Record.php

Summary

Maintainability
A
55 mins
Test Coverage
F
0%

Function getEditFieldsModel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getEditFieldsModel()
    {
        $moduleName = $this->getModule()->getName(true);
        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
        $fieldModels = [];
Severity: Minor
Found in modules/Settings/PBX/models/Record.php - About 55 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 Settings_PBX_Record_Model has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
Open

class Settings_PBX_Record_Model extends Settings_Vtiger_Record_Model
{
    /**
     * Edit fields.
     *

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

        $data = (new App\Db\Query())

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\Json' in method 'getInstanceById'.
Open

            $instance->param = \App\Json::decode($data['param']);

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 'Settings_Vtiger_Module_Model' in method 'getCleanInstance'.
Open

        $instance->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');

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 'Settings_Vtiger_Field_Model' in method 'getEditFieldsModel'.
Open

            $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $name]));

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 'Settings_Vtiger_Field_Model' in method 'getConnectorFieldsModel'.
Open

                $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $name]));

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_Link_Model' in method 'getRecordLinks'.
Open

            $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

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\Db' in method 'delete'.
Open

            $db = App\Db::getInstance();

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\Integrations\Pbx' in method 'getEditFieldsModel'.
Open

                foreach (App\Integrations\Pbx::getConnectors() as $connectorName => $instance) {

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 'Settings_Vtiger_Module_Model' in method 'getModule'.
Open

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');

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

            return $this->get($key) ? \App\Language::translate('LBL_YES') : \App\Language::translate('LBL_NO');

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\Integrations\Pbx' in method 'getConnectorFieldsModel'.
Open

        $connector = App\Integrations\Pbx::getConnectorInstance($this->get('type'));

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

        \App\Cache::staticSave('Settings_PBX_Record_Model', $id, $instance);

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

        $this->set('param', \App\Json::encode($params));

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\Integrations\Pbx' in method 'parseFromRequest'.
Open

        $connector = App\Integrations\Pbx::getConnectorInstance($data['type']);

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

        if (\App\Cache::staticHas('Settings_PBX_Record_Model', $id)) {

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

        } else {
            $seccess = $db->createCommand()->insert('s_#__pbx', $data)->execute();
            if ($seccess) {
                $this->set('pbxid', $db->getLastInsertID('s_#__pbx_pbxid_seq'));
            }

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

            return $this->get($key) ? \App\Language::translate('LBL_YES') : \App\Language::translate('LBL_NO');

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

                    $connectors[$connectorName] = \App\Language::translate($instance->name, $moduleName);

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\Db' in method 'save'.
Open

        $db = App\Db::getInstance();

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

        return \App\Purifier::encodeHtml($this->get($key));

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

            return \App\Cache::staticGet('Settings_PBX_Record_Model', $id);

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

        if (!empty($data['param'])) {

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

        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

        'default' => ['label' => 'LBL_DEFAULT', 'uitype' => 56, 'typeofdata' => 'C~O'],

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 "uitype" 4 times.
Open

        'type' => ['label' => 'LBL_TYPE', 'uitype' => 16],

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 "s_#__pbx" 5 times.
Open

            ->from('s_#__pbx')

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 "pbxid" 6 times.
Open

        return $this->get('pbxid');

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

        if (\App\Cache::staticHas('Settings_PBX_Record_Model', $id)) {

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

        'name' => ['label' => 'LBL_NAME'],

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 "default" 4 times.
Open

        'default' => ['label' => 'LBL_DEFAULT', 'uitype' => 56, 'typeofdata' => 'C~O'],

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 local variables such as '$value'.
Open

        foreach ($this->getEditFields() as $name => $value) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Avoid unused local variables such as '$config'.
Open

        foreach ($connector->configFields as $name => $config) {

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

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

        $data = (new App\Db\Query())
Severity: Critical
Found in modules/Settings/PBX/models/Record.php by phan

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

            $result = $db->createCommand()->delete('s_#__pbx', ['pbxid' => $recordId])->execute();
Severity: Critical
Found in modules/Settings/PBX/models/Record.php by phan

Reference to undeclared property \Settings_PBX_Record_Model->module
Open

        $this->module = $moduleModel;
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Reference to undeclared property \Settings_PBX_Record_Model->module
Open

        if (!$this->module) {
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Returning type \Vtiger_Field_Model[]|array{} but getConnectorFieldsModel() is declared to return \type
Open

        return $fieldModels;
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Argument 2 (key) is int but \App\Cache::staticSave() takes string defined at /code/app/Cache.php:156
Open

        \App\Cache::staticSave('Settings_PBX_Record_Model', $id, $instance);
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Return type of getCleanInstance() is undeclared type \self
Open

    public static function getCleanInstance()
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Return type of getConnectorFieldsModel() is undeclared type \type
Open

    public function getConnectorFieldsModel()
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Saw an @param annotation for request, but the param list of function save() : bool is empty
Open

     * @param \App\Request $request

Saw an @param annotation for name, but it was not found in the param list of function getDisplayValue(string $key) : string
Open

     * @param string $name

Saw an @param annotation for type, but it was not found in the param list of function getInstanceById(int $id) : \Settings_PBX_Record_Model|\self
Open

     * @param string $type

Argument 2 (key) is int but \App\Cache::staticHas() takes string defined at /code/app/Cache.php:141
Open

        if (\App\Cache::staticHas('Settings_PBX_Record_Model', $id)) {
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Reference to instance property configFields from undeclared class \App\Integrations\className
Open

            foreach ($connector->configFields as $name => $params) {
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Reference to undeclared property \Settings_PBX_Record_Model->module
Open

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

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

            $db->createCommand()->update('s_#__pbx', $data, ['pbxid' => $this->getId()])->execute();
Severity: Critical
Found in modules/Settings/PBX/models/Record.php by phan

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

            $seccess = $db->createCommand()->insert('s_#__pbx', $data)->execute();
Severity: Critical
Found in modules/Settings/PBX/models/Record.php by phan

Return type of getInstanceById() is undeclared type \self
Open

    public static function getInstanceById($id)
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Argument 2 (key) is int but \App\Cache::staticGet() takes string defined at /code/app/Cache.php:128
Open

            return \App\Cache::staticGet('Settings_PBX_Record_Model', $id);
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

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

            $db->createCommand()->update('s_#__pbx', ['default' => 0])->execute();
Severity: Critical
Found in modules/Settings/PBX/models/Record.php by phan

Reference to undeclared property \Settings_PBX_Record_Model->module
Open

        return $this->module;
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Reference to undeclared property \Settings_PBX_Record_Model->module
Open

        $instance->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Reference to instance property configFields from undeclared class \App\Integrations\className
Open

        foreach ($connector->configFields as $name => $config) {
Severity: Minor
Found in modules/Settings/PBX/models/Record.php by phan

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Settings_PBX_Record_Model extends Settings_Vtiger_Record_Model

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

        $db = App\Db::getInstance();

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 $db. Configured minimum length is 3.
Open

            $db = App\Db::getInstance();

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 static function getInstanceById($id)

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

The class Settings_PBX_Record_Model is not named in CamelCase.
Open

class Settings_PBX_Record_Model extends Settings_Vtiger_Record_Model
{
    /**
     * Edit fields.
     *

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

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

     */

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 (!$this->module) {

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 $key

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

    public function getEditFields()

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

                'linktype' => 'LISTVIEWRECORD',

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

            $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

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

        'default' => ['label' => 'LBL_DEFAULT', 'uitype' => 56, 'typeofdata' => 'C~O'],

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 Settings_PBX_Module_Model $moduleModel

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

        }

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

                'linkicon' => 'yfi yfi-full-editing-view',

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

     */

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

        'type' => ['label' => 'LBL_TYPE', 'uitype' => 16],

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

    public $param;

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

     * Function to get the confog param for a given key.

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 $key

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

    public function getParam($key)

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

     * Function to get Module 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

    /** {@inheritdoc} */

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

     *

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 array

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

        return $this->get('pbxid');

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

        $links = [];

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

                'linktype' => 'LISTVIEWRECORD',

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 the instance, given 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

     *

Line exceeds 120 characters; contains 146 characters
Open

            $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $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

    /**

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

     * Connector configuration.

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

     * @return mixed Value for the given key

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 $this->module;

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 ('default' === $key) {

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

            return $this->get($key) ? \App\Language::translate('LBL_YES') : \App\Language::translate('LBL_NO');

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

                'linklabel' => 'LBL_DELETE_RECORD',

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->editFields as $name => $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

            foreach ($connector->configFields as $name => $params) {

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

        if ($this->getId()) {

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

    public function getName()

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 $this->param[$key] ?? null;

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

     * @return Settings_PBX_Module_Model

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

                'modalView' => 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

     * @param string $type

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

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

     * Function removes record.

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

                $fieldModels[$name] = $fieldModel;

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

     */

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

            $seccess = 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

            $params[$name] = $data[$name] ?? null;

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

        return $this->get('name');

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

    public function setModule($moduleModel)

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

        return \App\Purifier::encodeHtml($this->get($key));

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::staticSave('Settings_PBX_Record_Model', $id, $instance);

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

     * Function to get the clean instance.

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

     * @return bool

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

            $db = App\Db::getInstance();

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 save()

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

        $this->set('param', \App\Json::encode($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

     * Function to set Module instance.

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

        $this->module = $moduleModel;

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

    public function getDisplayValue(string $key)

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 determines fields available in edition view.

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

        $recordLinks = [

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

                'linkurl' => 'index.php?module=PBX&parent=Settings&view=EditModal&record=' . $this->getId(),

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

                'linkclass' => 'btn btn-sm btn-primary',

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

        if (!empty($data['param'])) {

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

        $instance->setData($data);

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 ($recordId) {

Line exceeds 120 characters; contains 129 characters
Open

        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

            $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $name]));

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

                $fieldModel->set('isEditableReadOnly', 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

        $db = App\Db::getInstance();

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 $links;

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

        $recordId = $this->getId();

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

        $moduleName = $this->getModule()->getName(true);

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

        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

Line exceeds 120 characters; contains 150 characters
Open

                $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $name]));

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

        if ($data['default']) {

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

            $db->createCommand()->update('s_#__pbx', $data, ['pbxid' => $this->getId()])->execute();

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

        'name' => ['label' => 'LBL_NAME'],

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

     * @var array

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

     * Record 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

     */

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

    public function getRecordLinks(): array

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

        foreach ($recordLinks as $recordLink) {

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 int    $id

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

     * @return \self

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

            ->one();

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

    public function delete()

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

    public function getEditFieldsModel()

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

                foreach (App\Integrations\Pbx::getConnectors() as $connectorName => $instance) {

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

                $params['picklistValues'] = $connectors;

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 $fieldModels;

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

            $db->createCommand()->update('s_#__pbx', ['default' => 0])->execute();

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

            $this->set($name, $data[$name] ?? null);

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

     * Record 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

     * @return $this

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

     */

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

                'linklabel' => 'LBL_EDIT_RECORD',

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

    public static function getCleanInstance()

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

        $instance->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');

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 parseFromRequest($data)

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

        $connector = App\Integrations\Pbx::getConnectorInstance($data['type']);

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 getId()

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

        return $this->editFields;

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

                'linkurl' => 'javascript:Settings_Vtiger_List_Js.deleteById(' . $this->getId() . ');',

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

        $instance = new self();

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 Settings_Vtiger_Field_Model[]

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

            $fieldModel->set('fieldvalue', $this->get($name));

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

     * @param \App\Request $request

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->getEditFields() as $name => $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

            $this->module = Settings_Vtiger_Module_Model::getInstance('Settings:PBX');

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 $this;

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

     * @param string $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

        if (\App\Cache::staticHas('Settings_PBX_Record_Model', $id)) {

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

        $instance = self::getCleanInstance();

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

        return $instance;

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

                $connectors = [];

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

    }

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

    private $editFields = [

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

            ],

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 static function getInstanceById($id)

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

        $data = (new App\Db\Query())

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

            ->from('s_#__pbx')

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

            ->where(['pbxid' => $id])

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

            $instance->param = \App\Json::decode($data['param']);

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

        $fieldModels = [];

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

                $fieldModel->set('fieldvalue', $this->getParam($name));

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

            if ($seccess) {

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

     * Parse dana from request.

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

     *

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

     * Edit fields.

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 getModule()

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

     * Function to get the Display Value, for the current field type with given DB Insert 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

    /**

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

    {

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

                'linkicon' => 'fas fa-trash-alt',

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

                'linkclass' => 'btn btn-sm btn-danger',

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

        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

            if ('type' === $name && $this->getId()) {

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

     * Get connector config fields model.

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

     * Save pbx instance.

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

            $seccess = $db->createCommand()->insert('s_#__pbx', $data)->execute();

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

            $result = $db->createCommand()->delete('s_#__pbx', ['pbxid' => $recordId])->execute();

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

        return !empty($result);

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

                    $connectors[$connectorName] = \App\Language::translate($instance->name, $moduleName);

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

            $fieldModels[$name] = $fieldModel;

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

     * @return type

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

        $data = $this->getData();

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

        $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

            return \App\Cache::staticGet('Settings_PBX_Record_Model', $id);

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

     * Get edit fields model.

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

        $moduleName = $this->getModule()->getName(true);

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

            if ('type' === $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

    public function getConnectorFieldsModel()

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

        $fieldModels = [];

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

        if ($connector) {

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 $seccess;

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

        $this->param = $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

        return $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

            }

Line exceeds 120 characters; contains 129 characters
Open

        $mainParams = ['uitype' => 1, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

                $fieldModel = Settings_Vtiger_Field_Model::init($moduleName, array_merge($mainParams, $params, ['column' => $name, 'name' => $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

     * @return bool

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

                $this->set('pbxid', $db->getLastInsertID('s_#__pbx_pbxid_seq'));

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

     * @param array $data

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

            unset($data['pbxid']);

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

        return $fieldModels;

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

        $connector = App\Integrations\Pbx::getConnectorInstance($this->get('type'));

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 ($connector->configFields as $name => $config) {

Class name "Settings_PBX_Record_Model" is not in camel caps format
Open

class Settings_PBX_Record_Model extends Settings_Vtiger_Record_Model

There are no issues that match your filters.

Category
Status