YetiForceCompany/YetiForceCRM

View on GitHub
modules/Chat/actions/Room.php

Summary

Maintainability
A
1 hr
Test Coverage
F
0%

Function checkPermissionByRoom has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkPermissionByRoom(App\Request $request): void
    {
        switch ($request->getByType('roomType')) {
            case 'crm':
                $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.php - About 1 hr 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 method checkPermissionByRoom() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
Open

    private function checkPermissionByRoom(App\Request $request): void
    {
        switch ($request->getByType('roomType')) {
            case 'crm':
                $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.php by phpmd

CyclomaticComplexity

Since: 0.1

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

Example

// Cyclomatic Complexity = 11
class Foo {
1   public function example() {
2       if ($a == $b) {
3           if ($a1 == $b1) {
                fiddle();
4           } elseif ($a2 == $b2) {
                fiddle();
            } else {
                fiddle();
            }
5       } elseif ($c == $d) {
6           while ($c == $d) {
                fiddle();
            }
7        } elseif ($e == $f) {
8           for ($n = 0; $n < $h; $n++) {
                fiddle();
            }
        } else {
            switch ($z) {
9               case 1:
                    fiddle();
                    break;
10              case 2:
                    fiddle();
                    break;
11              case 3:
                    fiddle();
                    break;
                default:
                    fiddle();
                    break;
            }
        }
    }
}

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

Missing class import via use statement (line '39', column '14').
Open

            throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 406);
Severity: Minor
Found in modules/Chat/actions/Room.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 '90', column '19').
Open

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Chat/actions/Room.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 '134', column '15').
Open

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Chat/actions/Room.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 '115', column '16').
Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Chat/actions/Room.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 '120', column '16').
Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Chat/actions/Room.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 '126', column '16').
Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in modules/Chat/actions/Room.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 '55', column '19').
Open

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Chat/actions/Room.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 '72', column '19').
Open

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Chat/actions/Room.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 'Vtiger_Record_Model' in method 'checkPermissionByRoom'.
Open

                $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.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 'addToFavorites'.
Open

        $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.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 '\Users_Privileges_Model' in method 'checkPermission'.
Open

        $userPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
Severity: Minor
Found in modules/Chat/actions/Room.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 'checkPermissionByRoom'.
Open

                $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));
Severity: Minor
Found in modules/Chat/actions/Room.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 "ERR_NO_PERMISSIONS_FOR_THE_RECORD" 4 times.
Open

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Critical
Found in modules/Chat/actions/Room.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" 5 times.
Open

        $result = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites();
Severity: Critical
Found in modules/Chat/actions/Room.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" 7 times.
Open

        $result = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites();
Severity: Critical
Found in modules/Chat/actions/Room.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.

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

        \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites($request->getInteger('userId'));
Severity: Critical
Found in modules/Chat/actions/Room.php by phan

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

                $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));
Severity: Critical
Found in modules/Chat/actions/Room.php by phan

Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
Open

        if (!$userPrivileges->hasModulePermission($request->getModule()) || $userPrivileges->getId() !== $userPrivileges->getRealId()) {
Severity: Minor
Found in modules/Chat/actions/Room.php by phan

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

    public function removeFromFavorites(App\Request $request)
Severity: Minor
Found in modules/Chat/actions/Room.php by phan

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

        $result = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites();
Severity: Critical
Found in modules/Chat/actions/Room.php by phan

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

                if (!\in_array($request->getInteger('recordId'), \App\User::getCurrentUserModel()->getGroups())) {
Severity: Critical
Found in modules/Chat/actions/Room.php by phan

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

        $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));
Severity: Critical
Found in modules/Chat/actions/Room.php by phan

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

    public function addToFavorites(App\Request $request)
Severity: Minor
Found in modules/Chat/actions/Room.php by phan

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

    public function removeUserFromRoom(App\Request $request)
Severity: Minor
Found in modules/Chat/actions/Room.php by phan

This case's code block is the same as the block for the case on line 129.
Open

            case 'user':
                break;
Severity: Major
Found in modules/Chat/actions/Room.php by sonar-php

Having two cases in a switch statement or two branches in an if chain with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if chain they should be combined, or for a switch, one should fall through to the other.

Noncompliant Code Example

switch ($i) {
  case 1:
    doSomething();
    break;
  case 2:
    doSomethingDifferent();
    break;
  case 3:  // Noncompliant; duplicates case 1's implementation
    doSomething();
    break;
  default:
    doTheRest();
}

if ($a >= 0 && $a < 10) {
  doTheThing();
else if ($a >= 10 && $a < 20) {
  doTheOtherThing();
}
else if ($a >= 20 && $a < 50) {
  doTheThing();  // Noncompliant; duplicates first condition
}
else {
  doTheRest();
}

if ($b == 0) {
  doOneMoreThing();
}
else {
  doOneMoreThing(); // Noncompliant; duplicates then-branch
}

var b = a ? 12 > 4 : 4;  // Noncompliant; always results in the same value

Compliant Solution

switch ($i) {
  case 1:
  case 3:
    doSomething();
    break;
  case 2:
    doSomethingDifferent();
    break;
  default:
    doTheRest();
}

if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) {
  doTheThing();
else if ($a >= 10 && $a < 20) {
  doTheOtherThing();
}
else {
  doTheRest();
}

doOneMoreThing();

b = 4;

or

switch ($i) {
  case 1:
    doSomething();
    break;
  case 2:
    doSomethingDifferent();
    break;
  case 3:
    doThirdThing();
    break;
  default:
    doTheRest();
}

if ($a >= 0 && $a < 10) {
  doTheThing();
else if ($a >= 10 && $a < 20) {
  doTheOtherThing();
}
else if ($a >= 20 && $a < 50) {
  doTheThirdThing();
}
else {
  doTheRest();
}

if ($b == 0) {
  doOneMoreThing();
}
else {
  doTheRest();
}

int b = a ? 12 > 4 : 8;

Exceptions

Blocks in an if chain that contain a single line of code are ignored, as are blocks in a switch statement that contain a single line of code with or without a following break.

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

class Chat_Room_Action extends \App\Controller\Action

The class Chat_Room_Action is not named in CamelCase.
Open

class Chat_Room_Action extends \App\Controller\Action
{
    use \App\Controller\ExposeMethod;

    /**
Severity: Minor
Found in modules/Chat/actions/Room.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

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

        $result = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites();

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

     * @throws \App\Exceptions\IllegalValue

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

    {

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

     * @param \App\Request $request

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

    {

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

     *

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

        $this->checkPermissionByRoom($request);

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

        $response->setResult($chat->getQueryRoom()->one());

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

    /**

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

    public function __construct()

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

     * @throws \App\Exceptions\IllegalValue

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

     * @throws \yii\db\Exception

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

    public function removeFromFavorites(App\Request $request)

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

        $response->setResult($result);

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

     *

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

     */

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

     * Constructor with a list of allowed methods.

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

     */

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

     *

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

    }

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

     * Remove from favorites.

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

    /**

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

    }

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

        $response = new Vtiger_Response();

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

    use \App\Controller\ExposeMethod;

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

        if (!$userPrivileges->hasModulePermission($request->getModule()) || $userPrivileges->getId() !== $userPrivileges->getRealId()) {

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

    /**

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

        $response->emit();

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

        $this->checkPermissionByRoom($request);

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

        return false;

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

    {

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

     * @throws \yii\db\Exception

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

    public function isSessionExtend(App\Request $request)

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

        parent::__construct();

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

        $this->exposeMethod('removeFromFavorites');

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

            throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 406);

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

        }

Line exceeds 120 characters; contains 151 characters
Open

        \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites($request->getInteger('userId'));

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

    }

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

        $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));

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

     * @throws \App\Exceptions\IllegalValue

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

                if (!$recordModel->isViewable()) {

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

                break;

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

     * @throws \App\Exceptions\NoPermitted

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

        $this->checkPermissionByRoom($request);

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

     *

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

    {

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

        $chat->addToFavorites();

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

    }

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

                }

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

                break;

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

     * Function to check permission.

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

     *

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

    {

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

     *

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

     */

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

    {

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

     * Check permission by room.

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

    private function checkPermissionByRoom(App\Request $request): void

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

    /**

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

    }

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

     * @throws \yii\db\Exception

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

    /** {@inheritdoc} */

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

        switch ($request->getByType('roomType')) {

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

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

                break;

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

     * @param \App\Request $request

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

    public function checkPermission(App\Request $request)

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

     * @param \App\Request $request

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

    /**

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

     */

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

     *

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

        $response->setResult(true);

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

     * Add to favorites.

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

        }

Line exceeds 120 characters; contains 136 characters
Open

        if (!$userPrivileges->hasModulePermission($request->getModule()) || $userPrivileges->getId() !== $userPrivileges->getRealId()) {

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

    /**

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

     *

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

        $response = new Vtiger_Response();

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

        $response->emit();

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

     * Remove user from room.

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

     * @param \App\Request $request

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

        $response = new Vtiger_Response();

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

    }

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

     *

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

            default:

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

        $this->exposeMethod('removeUserFromRoom');

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

        $this->exposeMethod('addToFavorites');

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

        $userPrivileges = \Users_Privileges_Model::getCurrentUserPrivilegesModel();

Line exceeds 120 characters; contains 131 characters
Open

        $result = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites();

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

     */

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

        \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'))->removeFromFavorites($request->getInteger('userId'));

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

     * @throws \App\Exceptions\IllegalValue

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

        $response->emit();

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

                $chat = \App\Chat::getInstance($request->getByType('roomType'), $request->getInteger('recordId'));

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

            case 'global':

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

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

            case 'private':

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

                break;

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

    public function removeUserFromRoom(App\Request $request)

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

    public function addToFavorites(App\Request $request)

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

                if (!$chat->isRoomModerator($request->getInteger('recordId')) && !$chat->isRecordOwner()) {

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

            case 'user':

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

     * @param \App\Request $request

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

    }

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

            case 'group':

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

                }

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

                }

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

     */

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

    {

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

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

                    throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

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

                break;

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

            case 'crm':

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

                $recordModel = Vtiger_Record_Model::getInstanceById($request->getInteger('recordId'));

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

                if (!\in_array($request->getInteger('recordId'), \App\User::getCurrentUserModel()->getGroups())) {

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

     *

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

     * @throws \App\Exceptions\NoPermittedToRecord

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

class Chat_Room_Action extends \App\Controller\Action

There are no issues that match your filters.

Category
Status