YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

Method getRecordLinks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getRecordLinks(): array
    {
        $recordLinks = [
            [
                'linktype' => 'LISTVIEWRECORD',
Severity: Minor
Found in modules/Settings/Wapro/models/Record.php - About 1 hr to fix

    Avoid using static access to class 'App\Integrations\Wapro' in method 'getInstanceById'.
    Open

            $row = App\Integrations\Wapro::getById($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

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

            \App\Cache::delete('App\Integrations\Wapro::getById', $this->getId());

    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('admin');

    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: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 '\Vtiger_Field_Model' in method 'getFieldInstanceByName'.
    Open

            return \Vtiger_Field_Model::init($moduleName, $params, $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 '\App\Cache' in method 'save'.
    Open

            \App\Cache::delete('App\Integrations\Wapro::getById', $this->getId());

    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

                    $value = \App\Purifier::encodeHtml($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 '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

    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 {
                $result = $db->createCommand()->insert($tableName, $params)->execute();
                $this->set('id', $db->getLastInsertID("{$tableName}_id_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

                    $value = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(true));

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

                    'linkclass' => 'btn btn-secondary btn-sm js-list-sync'

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

                    'linkicon' => 'fas fa-list',

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

                    'linklabel' => 'LBL_SYNCHRONIZER_LIST',

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

                    'linktype' => 'LISTVIEWRECORD',

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

                    'linktype' => 'LISTVIEWRECORD',

    Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

    On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

    Noncompliant Code Example

    With the default threshold of 3:

    function run() {
      prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
      execute('action1');
      release('action1');
    }
    

    Compliant Solution

    ACTION_1 = 'action1';
    
    function run() {
      prepare(ACTION_1);
      execute(ACTION_1);
      release(ACTION_1);
    }
    

    Exceptions

    To prevent generating some false-positives, literals having less than 5 characters are excluded.

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

            $return = \App\Db::getInstance('admin')->createCommand()
    Severity: Critical
    Found in modules/Settings/Wapro/models/Record.php by phan

    Reference to undeclared property \Settings_Wapro_Record_Model->module
    Open

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

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

                $result = $db->createCommand()->insert($tableName, $params)->execute();
    Severity: Critical
    Found in modules/Settings/Wapro/models/Record.php by phan

    Reference to undeclared property \Settings_Wapro_Record_Model->module
    Open

            if (!isset($this->module)) {

    Reference to undeclared property \Settings_Wapro_Record_Model->module
    Open

            return $this->module;

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

                $result = $db->createCommand()->update($tableName, $params, ['id' => $this->getId()])->execute();
    Severity: Critical
    Found in modules/Settings/Wapro/models/Record.php by phan

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

            \App\Cache::delete('App\Integrations\Wapro::getById', $this->getId());

    Call to method getInstance from undeclared class \App\Encryption (Did you mean class \Tests\App\Encryption)
    Open

            $params['password'] = \App\Encryption::getInstance()->encrypt($params['password']);
    Severity: Critical
    Found in modules/Settings/Wapro/models/Record.php by phan

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

            \App\Cache::delete('App\Integrations\Wapro::getById', $this->getId());

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

    class Settings_Wapro_Record_Model extends Settings_Vtiger_Record_Model

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

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

    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(int $id): ?self

    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_Wapro_Record_Model is not named in CamelCase.
    Open

    class Settings_Wapro_Record_Model extends Settings_Vtiger_Record_Model
    {
        use App\Controller\Traits\RecordSettings;
    
        /**

    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

                    '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

        public function delete(): int

    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

                'fieldvalue' => $this->get($name) ?? $fields[$name]['default'] ?? '',

    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

            $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

        {

    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

            $row = App\Integrations\Wapro::getById($id);

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

            $instance->setData($row);

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

                    'linkclass' => 'btn btn-primary btn-sm js-edit-record-modal'

    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 ($recordLinks as $recordLink) {

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

            $return = \App\Db::getInstance('admin')->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

         * @return \Vtiger_Field_Model

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

                'typeofdata' => $fields[$name]['required'] ? 'V~M' : 'V~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

         * @return $this|null Instance, if exists

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

            if (empty($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

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

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

                    'linkclass' => 'btn text-white btn-danger btn-sm'

    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

         *

    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 getFieldInstanceByName($name): Vtiger_Field_Model

    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

                $this->set('id', $db->getLastInsertID("{$tableName}_id_seq"));

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

            return 'index.php?parent=Settings&module=Wapro&view=Edit&record=' . $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

            return $instance;

    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

                    'linkdata' => ['id' => $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

        /**

    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

         */

    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

         *

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

            return $return;

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

        use App\Controller\Traits\RecordSettings;

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

        {

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

                    'linkdata' => ['url' => $this->getEditViewUrl()],

    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

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

    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

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

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

                'maximumlength' => $fields[$name]['maximumlength'] ?? '',

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

                    'linklabel' => 'LBL_SYNCHRONIZER_LIST',

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

                $result = $db->createCommand()->update($tableName, $params, ['id' => $this->getId()])->execute();

    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

         *

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

                'label' => $fields[$name]['label'],

    Line exceeds 120 characters; contains 130 characters
    Open

                    $value = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(true));

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

         * Function to get the Edit View Url.

    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

                    'linkclass' => 'btn btn-secondary btn-sm js-list-sync'

    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

            return $links;

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

        public function save(): bool

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

            \App\Cache::delete('App\Integrations\Wapro::getById', $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

            \App\Cache::delete('App\Integrations\Wapro::getById', $this->getId());

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

            if (!isset($this->module)) {

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

        public function getEditViewUrl(): 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 $instance;

    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

                [

    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

                    'linktype' => 'LISTVIEWRECORD',

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

            return (bool) $result;

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

                ->delete($this->getModule()->baseTable, ['id' => $this->getId()])

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

        public function getModule(): Settings_Wapro_Module_Model

    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

            switch ($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

        public static function getCleanInstance(): self

    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

                    'linkicon' => 'fas fa-list',

    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

                ],

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

            $params = array_intersect_key($this->getData(), $this->getModule()->getFormFields());

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

            $params['password'] = \App\Encryption::getInstance()->encrypt($params['password']);

    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

                    break;

    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 = \App\Language::translate(1 == $value ? 'LBL_ACTIVE' : 'LBL_INACTIVE', $this->getModule()->getName(true));

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

                    $params['uitype'] = 56;

    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 URL

    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(int $id): ?self

    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

                [

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

         * Function to save.

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

            $tableName = $this->getModule()->baseTable;

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

                $result = $db->createCommand()->insert($tableName, $params)->execute();

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

         * Function to delete the current record model.

    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

         * @return Settings_Wapro_Module_Model

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

            $fields = $this->getModule()->getFormFields();

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

                case 'status':

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

                    $value = \App\Purifier::encodeHtml($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

                    $params['typeofdata'] = 'C~O';

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

                default:

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

                default:

    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

            switch ($key) {

    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

                return null;

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

            $instance->getModule();

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

        }

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

         * @throws ReflectionException

    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

         *

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

         */

    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

        /** {@inheritdoc} */

    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

         * Function to get the instance of record 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

        /** {@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

         * Gets field instance by name.

    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

                case 'status':

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

            return \Vtiger_Field_Model::init($moduleName, $params, $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

            $value = $this->get($key);

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

    class Settings_Wapro_Record_Model extends Settings_Vtiger_Record_Model

    There are no issues that match your filters.

    Category
    Status