YetiForceCompany/YetiForceCRM

View on GitHub
tests/Base/Z_Chat.php

Summary

Maintainability
A
3 hrs
Test Coverage
A
100%

testCurrentRoomAfterDeletingRecord accesses the super-global variable $_SESSION.
Open

    public function testCurrentRoomAfterDeletingRecord(): void
    {
        $this->assertSame($_SESSION['chat']['roomType'], 'crm');
        $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
        \vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testCurrentRoomAfterDeletingRecord accesses the super-global variable $_SESSION.
Open

    public function testCurrentRoomAfterDeletingRecord(): void
    {
        $this->assertSame($_SESSION['chat']['roomType'], 'crm');
        $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
        \vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testSwitchRoom accesses the super-global variable $_SESSION.
Open

    public function testSwitchRoom()
    {
        \App\Chat::setCurrentRoom('crm', self::$listId[0]);
        $this->assertSame($_SESSION['chat']['roomType'], 'crm');
        $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testSwitchRoom accesses the super-global variable $_SESSION.
Open

    public function testSwitchRoom()
    {
        \App\Chat::setCurrentRoom('crm', self::$listId[0]);
        $this->assertSame($_SESSION['chat']['roomType'], 'crm');
        $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testCurrentRoom accesses the super-global variable $_SESSION.
Open

    public function testCurrentRoom()
    {
        unset($_SESSION);
        \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
        $this->assertSame($_SESSION['chat']['roomType'], 'global');
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testCurrentRoom accesses the super-global variable $_SESSION.
Open

    public function testCurrentRoom()
    {
        unset($_SESSION);
        \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
        $this->assertSame($_SESSION['chat']['roomType'], 'global');
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

testCurrentRoom accesses the super-global variable $_SESSION.
Open

    public function testCurrentRoom()
    {
        unset($_SESSION);
        \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
        $this->assertSame($_SESSION['chat']['roomType'], 'global');
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The class Z_Chat has 16 public methods. Consider refactoring Z_Chat to keep number of public methods under 10.
Open

class Z_Chat extends \Tests\Base
{
    /**
     * ID list.
     *
Severity: Minor
Found in tests/Base/Z_Chat.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

File Z_Chat.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/**
 * Chat test class.
 *
Severity: Minor
Found in tests/Base/Z_Chat.php - About 2 hrs to fix

    Function getKeyRoom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function getKeyRoom($userRooms, string $roomType, int $recordId)
        {
            if (isset($userRooms[$roomType]) && \is_array($userRooms[$roomType])) {
                foreach ($userRooms[$roomType] as $key => $val) {
                    if ($val['recordid'] === $recordId) {
    Severity: Minor
    Found in tests/Base/Z_Chat.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

    The class Z_Chat has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
    Open

    class Z_Chat extends \Tests\Base
    {
        /**
         * ID list.
         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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 '18').
    Open

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

                (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

                (new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

                (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $row = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $this->assertFalse((new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $rowRoom = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Module' in method 'setUpBeforeClass'.
    Open

            self::$chatActive = \App\Module::isModuleActive('Chat');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testGroup'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testRemoveFromFavorites'.
    Open

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\Vtiger_Record_Model' in method 'testRemoveRecordCrm'.
    Open

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testAssigningToGroup'.
    Open

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testRemoveFromFavorites'.
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\Vtiger_Record_Model' in method 'testCreatingChatRoomCrm'.
    Open

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\Vtiger_Record_Model' in method 'testAddMessageCrm'.
    Open

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'setUpBeforeClass'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testAddMessageCrm'.
    Open

            $chat = \App\Chat::getInstance('crm', $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Module' in method 'testConfiguration'.
    Open

            $this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testAddNewMessage'.
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testCreatingChatRoomCrm'.
    Open

            $rooms = \App\Chat::getRoomsByUser();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testRoomCrm'.
    Open

            $chat = \App\Chat::getInstance('crm', self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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 '\vtlib\Functions' in method 'testCurrentRoomAfterDeletingRecord'.
    Open

            \vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'tearDownAfterClass'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testNewMessage'.
    Open

            \App\User::setCurrentUserId(self::$users[1]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Record' in method 'testCurrentRoomAfterDeletingRecord'.
    Open

            $this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testAssigningToGroup'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testAssigningToGroup'.
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testHistory'.
    Open

            $chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testGroup'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testGroup'.
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testHistory'.
    Open

            $userId = \App\User::getCurrentUserId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testNewMessage'.
    Open

            \App\User::setCurrentUserId(self::$users[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    StaticAccess

    Since: 1.4.0

    Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

    Example

    class Foo
    {
        public function bar()
        {
            Bar::baz();
        }
    }

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

    Avoid using static access to class '\Vtiger_Record_Model' in method 'tearDownAfterClass'.
    Open

                $recordModel = \Vtiger_Record_Model::getInstanceById($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'setUpBeforeClass'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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 'Tests\Base\C_RecordActions' in method 'setUpBeforeClass'.
    Open

            $recordModel = C_RecordActions::createContactRecord(false);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testSwitchRoom'.
    Open

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testAssigningToGroup'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testSwitchRoom'.
    Open

            \App\Chat::setCurrentRoom('crm', self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'tearDownAfterClass'.
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testCurrentRoom'.
    Open

            \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testCreatingChatRoomCrm'.
    Open

            $chat = \App\Chat::createRoom('crm', $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testRoomCrm'.
    Open

            $userId = \App\User::getActiveAdminId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testRoomCrm'.
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testGroup'.
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testAddNewMessage'.
    Open

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testNewMessage'.
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testAddMessageCrm'.
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testRoomCrm'.
    Open

            \App\User::setCurrentUserId($userId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testRoomCrm'.
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\User' in method 'testRoomCrm'.
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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\Chat' in method 'testCurrentRoomAfterDeletingRecord'.
    Open

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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 "userid" 9 times.
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            $this->assertSame($_SESSION['chat']['roomType'], 'global');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

    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 "Problem with the method "getEntries"" 3 times.
    Open

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

    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 "messages" 13 times.
    Open

            $this->assertSame('Test MSG', $rowMsg['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

    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 "Problem with the method "isNewMessages"" 6 times.
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

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

            $this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by sonar-php

    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 this unused private "getUserFromParticipants" method.
    Open

        private static function getUserFromParticipants($participants, int $userId)
    Severity: Major
    Found in tests/Base/Z_Chat.php by sonar-php

    private methods that are never executed are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.

    Noncompliant Code Example

    public class Foo
    {
      private function Foo() {}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
    
      public static function doSomething()
      {
        $foo = new Foo();
        ...
      }
    
      private function unusedPrivateFunction() {  // Noncompliant
      }
    }
    

    Compliant Solution

    public class Foo
    {
      private function Foo(){}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
    
      public static function doSomething()
      {
        $foo = new Foo();
      }
    }
    

    See

    Avoid unused private methods such as 'getUserFromParticipants'.
    Open

        private static function getUserFromParticipants($participants, int $userId)
        {
            foreach ($participants as $key => $val) {
                if ($val['user_id'] === $userId) {
                    return $key;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    UnusedPrivateMethod

    Since: 0.2

    Unused Private Method detects when a private method is declared but is unused.

    Example

    class Something
    {
        private function foo() {} // unused
    }

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

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

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
    Open

            $this->assertIsInt($id);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $rowMsg = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getActiveAdminId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertGreaterThanOrEqual
    Open

            $this->assertGreaterThanOrEqual(1, \count($groups), 'No defined groups');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $row = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame('Test MSG', $rowMsg['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertCount
    Open

            $this->assertCount($cntEntries + 1, $entries, 'Too many messages in the chat room');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getActiveAdminId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getActiveAdminId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method createRoom from undeclared class \App\Chat
    Open

            $chat = \App\Chat::createRoom('crm', $recordModel->getId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($currentRoom['recordId'], self::$listId[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userName, $message['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
    Open

            $this->assertIsInt($row['last_message'], 'Problem with methods "addToFavorites"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

            $this->assertSame($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getRoomsByUser from undeclared class \App\Chat
    Open

            $rooms = \App\Chat::getRoomsByUser();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('crm', $recordModel->getId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['roomType'], 'crm');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessagesForCrm from undeclared class \App\Chat
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
    Open

            $this->assertIsInt($id);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse(self::$globalRoom, 'The general chat room not exists.');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(self::$users[1]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

                ->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordModel->getId()])->one();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentRoom from undeclared class \App\Chat
    Open

            \App\Chat::setCurrentRoom('crm', self::$listId[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
    Open

                $this->assertNotNull($message['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Argument 1 (moduleName) is 'Chat' but \Settings_ModuleManager_Module_Model::disableModule() takes \type defined at /code/modules/Settings/ModuleManager/models/Module.php:110
    Open

                (new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phan

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

            $this->assertFalse((new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentRoom from undeclared class \App\Chat
    Open

            \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(self::$users[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($key, 'Problem with the method "getRoomsByUser". Crm id=' . $recordModel->getId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $rowMsg = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance('crm', self::$listId[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['roomType'], 'crm');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($row, 'Problem with methods "addToFavorites"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userId, $message['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
    Open

            $this->assertIsArray($globalGroup);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
    Open

            $this->assertIsInt($id);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

                    ->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordId])->exists(),
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame('test2', $rowMsg['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getActiveAdminId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $userId = \App\User::getActiveAdminId();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $rowMsg = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $userName = \App\User::getCurrentUserModel()->getName();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
    Open

            $this->assertIsArray($globalCrm);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userName, $message['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userName, $message['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                    ->from(\App\Chat::TABLE_NAME['room']['crm'])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                    ->from(\App\Chat::TABLE_NAME['message']['crm'])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['roomType'], 'global');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserModel from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $rowRoom = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentRoom from undeclared class \App\Chat
    Open

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getActiveAdminId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($rowRoom, "The chat room {$recordModel->getId()} does not exist");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId($userId);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

                ->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotFalse
    Open

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($recordModel->getId(), $chat->getRecordId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($currentRoom['roomType'], 'crm');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

                (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsArray
    Open

            $this->assertIsArray($globalHistory);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userId, $message['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame('test', $rowMsg['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessagesForCrm from undeclared class \App\Chat
    Open

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $userId = \App\User::getCurrentUserId();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method isNewMessages from undeclared class \App\Chat
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getInstance from undeclared class \App\Chat
    Open

            $chat = \App\Chat::getInstance();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant TABLE_NAME from undeclared class \App\Chat
    Open

                ->from(\App\Chat::TABLE_NAME['room']['crm'])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($recordModel->getModuleName(), $rooms['crm'][$key]['moduleName']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame($recordModel->getId(), $rooms['crm'][$key]['recordid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentRoom from undeclared class \App\Chat
    Open

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
    Open

                $this->assertNotNull($message['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

                $this->assertSame($userId, $message['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

                (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

                ->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse((new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertTrue
    Open

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertNotNull
    Open

                $this->assertNotNull($message['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Reference to constant COLUMN_NAME from undeclared class \App\Chat
    Open

                    ->where([\App\Chat::COLUMN_NAME['message']['crm'] => $recordId])->exists(),
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    @throws type of testRemoveFromFavorites has undeclared type \yii\db\Exception (Did you mean class \Exception)
    Open

        public function testRemoveFromFavorites()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertIsInt
    Open

            $this->assertIsInt($id);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $rowMsg = (new \App\Db\Query())
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertSame
    Open

            $this->assertSame('testRoomCrm', $rowMsg['messages']);
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

    Call to undeclared method \Tests\Base\Z_Chat::assertFalse
    Open

            $this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
    Severity: Critical
    Found in tests/Base/Z_Chat.php by phan

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

            $id = $chat->addMessage('Test MSG');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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

            $id = $chat->addMessage('test');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

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

    class Z_Chat extends \Tests\Base
    {
        /**
         * ID list.
         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

        private static function getKeyMessage($entries, int $id)
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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

            $id = $chat->addMessage('test2');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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

            $id = $chat->addMessage('testRoomCrm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpmd

    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

         * Is chat active.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @codeCoverageIgnore
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                foreach ($userRooms[$roomType] as $key => $val) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            return false;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            self::$users[] = A_User::createUsersRecord('test_1')->getId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @return int|false
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param int   $userId
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                if ($val['user_id'] === $userId) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @var int[]
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            return false;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param int   $id
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach ($participants as $key => $val) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            self::$listId[] = $recordModel->getId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static $users = [];
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param array  $userRooms
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordModel = C_RecordActions::createContactRecord(false);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testConfiguration()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static $listId;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static function getUserFromParticipants($participants, int $userId)
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    return $key;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue(\App\Module::isModuleActive('Chat'), 'The chat module is inactive');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Check if the general chat room exists.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @var bool|array
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach ($entries as $key => $val) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @var bool
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param string $roomType
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Configuration testing.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @var int[]
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    if ($val['recordid'] === $recordId) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                        return $key;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Get key of message.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @codeCoverageIgnore
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public static function setUpBeforeClass(): void
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testGeneralRoom()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    return $key;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Get user from participants.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * ID list.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            return false;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @return bool|int
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static function getKeyMessage($entries, int $id)
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static $globalRoom = false;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Get key of chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            self::$chatActive = \App\Module::isModuleActive('Chat');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsInt($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $entries = $chat->getEntries();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static $chatActive = false;
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                if ($val['id'] === $id) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Setting of tests.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            self::$users[] = A_User::createUsersRecord('test_2')->getId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testRemoveFromFavorites()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\Chat::setCurrentRoom('global', self::$globalRoom['global_room_id']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testAddNewMessage()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing creating a chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testNewMessage()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->getEntries();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * List of user IDs.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        private static function getKeyRoom($userRooms, string $roomType, int $recordId)
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param array $entries
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param array $participants
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groupId = \key($groups);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Remove test from favorites.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groupId = \key($groups);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->removeFromFavorites();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse((new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing adding messages.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(self::$users[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            // $chat = \App\Chat::getInstance();  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse(self::$globalRoom, 'The general chat room not exists.');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertGreaterThanOrEqual(1, \count($groups), 'No defined groups');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertCount($cntEntries + 1, $entries, 'Too many messages in the chat room');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['id' => $id])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \App\Exceptions\IllegalValue
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->addMessage('test 2');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groupId = \key($groups);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testCreatingChatRoomCrm()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::createRoom('crm', $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $id = $chat->addMessage('test');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //Switch user
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rowRoom = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['room']['crm'])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($currentRoom['recordId'], self::$globalRoom['global_room_id']);  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $cntEntries = \count($chat->getEntries());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $id = $chat->addMessage('Test MSG');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing the method of the current chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['id' => $id])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            self::$globalRoom = (new \App\Db\Query())->from('u_#__chat_global')->where(['name' => 'LBL_GENERAL'])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($chat->getRecordId(), self::$globalRoom['global_room_id']);  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testGroup()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse($chat->isAssigned(), "The user should not be assigned '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame('Test MSG', $rowMsg['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->andWhere([\App\Chat::COLUMN_NAME['room'][$chat->getRoomType()] => $groupId])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsInt($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //Switch user
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Global room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @param int    $recordId
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            if (isset($userRooms[$roomType]) && \is_array($userRooms[$roomType])) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @codeCoverageIgnore
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @return bool|int|string
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$currentRoom = \App\Chat::getCurrentRoom();  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['userid' => \App\User::getCurrentUserId()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $entries = $chat->getEntries();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->getEntries();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($chat->getRoomType(), 'global');  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $groups = \App\User::getCurrentUserModel()->getGroupNames();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Test assigning a user to a group room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($row, 'Problem with methods "addToFavorites"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            );
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame('test', $rowMsg['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing the method for checking new messages.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Chat testing for groups.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('group', $groupId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $key = self::getKeyMessage($entries, $id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->addToFavorites();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsInt($row['last_message'], 'Problem with methods "addToFavorites"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->exists(),
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['roomType'], 'global');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testAssigningToGroup()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $row = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \yii\db\Exception
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            unset($_SESSION);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($rowRoom, "The chat room {$recordModel->getId()} does not exist");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($currentRoom['roomType'], 'global');  ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isRoomExists(), "The chat room does not exist '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \App\Exceptions\IllegalValue
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['room'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testCurrentRoom()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $key = self::getKeyMessage($entries, $id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertTrue($chat->isAssigned(), "The user should be assigned '{$groups[$groupId]}'");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                'Problem with methods "removeFromFavorites"'
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['recordId'], self::$globalRoom['global_room_id']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Chat::isNewMessages(), 'Problem with the method "isNewMessages"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(self::$users[1]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordModel->getId()])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $key = self::getKeyRoom($rooms, 'crm', (int) $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserModel()->getName(), $entries[$key]['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach ($globalHistory as $message) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach ($globalGroup as $message) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    ->where([\App\Chat::COLUMN_NAME['message']['crm'] => $recordId])->exists(),
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testCurrentRoomAfterDeletingRecord(): void
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $id = $chat->addMessage('test2');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame('test2', $rowMsg['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testSwitchRoom()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\Chat::setCurrentRoom('crm', self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsArray($globalCrm);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach ($globalCrm as $message) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($key, 'Problem with the method "getRoomsByUser". Crm id=' . $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \App\Exceptions\IllegalValue
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userName, $message['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userName, $message['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($recordModel->getModuleName(), $rooms['crm'][$key]['moduleName']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat->addToFavorites();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertNotNull($message['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rooms = \App\Chat::getRoomsByUser();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testAddMessageCrm()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame('testRoomCrm', $rowMsg['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \Exception
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            if (!self::$chatActive) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($recordModel->getId(), $chat->getRecordId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing adding messages to Crm chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($key, 'Problem with the method "getEntries"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId($userId);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('crm', self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $globalGroup = $chat->getHistoryByType('group');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $userId = \App\User::getActiveAdminId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($currentRoom['recordId'], self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Message history test.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $globalHistory = $chat->getHistoryByType('global');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \App\User::setCurrentUserId(\App\User::getActiveAdminId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsInt($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @throws \App\Exceptions\IllegalValue
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('global', self::$globalRoom['global_room_id']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userId, $message['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userId, $message['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userId, $message['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testRemoveRecordCrm(): void
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            );
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $currentRoom = \App\Chat::getCurrentRoom();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            foreach (self::$listId as $id) {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsInt($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    ->from(\App\Chat::TABLE_NAME['room']['crm'])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($currentRoom['recordId'], self::$globalRoom['global_room_id']); ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                "Messages {$recordId} exist"
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Test the current chat room after deleting the record.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Cleaning after tests.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['id' => $id])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $key = self::getKeyMessage($entries, $id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing a CRM chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $userId = \App\User::getCurrentUserId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertSame($userName, $message['user_name']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordId = $recordModel->getId();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    ->where([\App\Chat::COLUMN_NAME['room']['crm'] => $recordId])->exists(),
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            );
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($recordModel->getId(), $rowRoom[\App\Chat::COLUMN_NAME['room']['crm']]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($recordModel->getId(), $rooms['crm'][$key]['recordid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $chat = \App\Chat::getInstance('crm', $recordModel->getId());
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $rowMsg = (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($rowMsg['messages'], $entries[$key]['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $userName = \App\User::getCurrentUserModel()->getName();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testRoomCrm()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertNotNull($message['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->from(\App\Chat::TABLE_NAME['message'][$chat->getRoomType()])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Testing the removal of Crm chat room.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsArray($globalGroup);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                (new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordModel->delete();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                "The chat room {$recordId} does exist"
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * @codeCoverageIgnore
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['roomType'], 'crm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            unset(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $recordModel->delete();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Chat::isNewMessagesForCrm($userId), 'Problem with the method "isNewMessagesForCrm"');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                ->where(['id' => $id])->one();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame(\App\User::getCurrentUserId(), $rowMsg['userid']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['roomType'], 'crm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                    ->from(\App\Chat::TABLE_NAME['message']['crm'])
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                (new \Settings_ModuleManager_Module_Model())->disableModule('Chat');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($currentRoom['roomType'], 'crm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertIsArray($globalHistory);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertFalse(\App\Record::isExists(self::$listId[0]), 'The record should not exist');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            //$this->assertSame($currentRoom['roomType'], 'global'); ???
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public static function tearDownAfterClass(): void
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $recordModel = \Vtiger_Record_Model::getInstanceById($id);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $entries = $chat->getEntries();
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $id = $chat->addMessage('testRoomCrm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertNotFalse($rowMsg, "The message {$id} does not exist");
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         * Chat room switching test.
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        public function testHistory()
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $globalCrm = $chat->getHistoryByType('crm');
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

                $this->assertNotNull($message['messages']);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $recordModel = \Vtiger_Record_Model::getInstanceById(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            $this->assertSame($_SESSION['chat']['recordId'], self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

            \vtlib\Functions::clearCacheMetaDataRecord(self::$listId[0]);
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

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

    class Z_Chat extends \Tests\Base
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

    Opening parenthesis of a multi-line function call must be the last content on the line
    Open

            $this->assertFalse((new \App\Db\Query())
    Severity: Minor
    Found in tests/Base/Z_Chat.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status