YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/actions/Calendar.php

Summary

Maintainability
A
35 mins
Test Coverage
F
0%

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

    public function pinOrUnpinUser(App\Request $request): void
    {
        $db = \App\Db::getInstance();
        $userId = \App\User::getCurrentUserId();
        if (!$request->isEmpty('element_id')) {
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 Vtiger_Calendar_Action has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
Open

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

    /**
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 '32', column '14').
Open

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

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

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 '35', column '14').
Open

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

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

        $response = new Vtiger_Response();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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\Privilege' in method 'checkPermission'.
Open

        if ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\App\Privilege::isPermitted($moduleName, 'EditView', $request->getInteger('id')))) {
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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\Fields\DateTime' in method 'getCountEventsGroup'.
Open

            $record->set('start', App\Fields\DateTime::formatToDisplay($datePair[0] . ' 00:00:00'));
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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_CalendarRightPanel_Model' in method 'pinOrUnpinUser'.
Open

                $users = Vtiger_CalendarRightPanel_Model::getFavoriteUsers($request->getModule());
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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_Calendar_Model' in method 'updateEvent'.
Open

        $record = Vtiger_Calendar_Model::getInstance($request->getModule());
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 'pinOrUnpinUser'.
Open

        $userId = \App\User::getCurrentUserId();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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

        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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\Db' in method 'pinOrUnpinUser'.
Open

        $db = \App\Db::getInstance();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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_Module_Model' in method 'checkPermission'.
Open

        if (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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\Cache' in method 'pinOrUnpinUser'.
Open

                \App\Cache::delete('FavoriteUsers', $userId);
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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_Calendar_Model' in method 'getCalendarModel'.
Open

        $record = Vtiger_Calendar_Model::getInstance($request->getModule());
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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\Fields\DateTime' in method 'getCountEventsGroup'.
Open

            $record->set('end', App\Fields\DateTime::formatToDisplay($datePair[1] . ' 23:59:59'));
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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

The method pinOrUnpinUser uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                } else {
                    $db->createCommand()->delete('u_#__users_pinned', ['id' => $users[$id]])->execute();
                    $result = 'unpin';
                }
Severity: Minor
Found in modules/Vtiger/actions/Calendar.php by phpmd

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

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

Avoid using static access to class '\App\User' in method 'pinOrUnpinUser'.
Open

            if (\App\User::isExists($id)) {
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 'pinOrUnpinUser'.
Open

                        'tabid' => \App\Module::getModuleId($request->getModule()),
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 "start" 5 times.
Open

            $record->set('start', App\Fields\DateTime::formatToDisplay($datePair[0] . ' 00:00:00'));
Severity: Critical
Found in modules/Vtiger/actions/Calendar.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 "filters" 3 times.
Open

        if ($request->has('filters')) {
Severity: Critical
Found in modules/Vtiger/actions/Calendar.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 undeclared method \App\Db::createCommand
Open

                    $db->createCommand()->insert('u_#__users_pinned', [
Severity: Critical
Found in modules/Vtiger/actions/Calendar.php by phan

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

                    $db->createCommand()->delete('u_#__users_pinned', ['id' => $users[$id]])->execute();
Severity: Critical
Found in modules/Vtiger/actions/Calendar.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 (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 modules/Vtiger/actions/Calendar.php by phan

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

            if (\App\User::isExists($id)) {
Severity: Critical
Found in modules/Vtiger/actions/Calendar.php by phan

Call to method getFavoriteUsers from undeclared class \Vtiger_CalendarRightPanel_Model
Open

                $users = Vtiger_CalendarRightPanel_Model::getFavoriteUsers($request->getModule());
Severity: Critical
Found in modules/Vtiger/actions/Calendar.php by phan

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

class Vtiger_Calendar_Action extends \App\Controller\Action

The class Vtiger_Calendar_Action is not named in CamelCase.
Open

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

    /**
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 $db. Configured minimum length is 3.
Open

        $db = \App\Db::getInstance();
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 = $request->getInteger('element_id');
Severity: Minor
Found in modules/Vtiger/actions/Calendar.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 for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

    public function getCalendarModel(App\Request $request): Vtiger_Calendar_Model

Spaces must be used for alignment; tabs are not allowed
Open

     * @throws \App\Exceptions\NoPermitted

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

        $response->emit();

Spaces must be used for alignment; tabs are not allowed
Open

     * @return Vtiger_Calendar_Model

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

                        'user_id' => $userId,

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    public function getEvents(App\Request $request)

Spaces must be used for alignment; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

        $request->delete('end');

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

     * @param \App\Request $request

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

        $this->exposeMethod('getEventsYear');

Spaces must be used for alignment; tabs are not allowed
Open

     * @param App\Request $request

Spaces must be used for alignment; tabs are not allowed
Open

        $record->set('user', $request->getArray('user', 'Alnum'));

Spaces must be used for alignment; tabs are not allowed
Open

        $response->emit();

Spaces must be used for alignment; tabs are not allowed
Open

     * @param App\Request $request

Spaces must be used for alignment; tabs are not allowed
Open

                if (empty($users[$id])) {

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

        parent::__construct();

Spaces must be used for alignment; tabs are not allowed
Open

        foreach ($request->getArray('dates', 'date') as $datePair) {

Spaces must be used for alignment; tabs are not allowed
Open

     * Get calendar model.

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('start', $request->getByType('start', 'DateInUserFormat'));

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

    public function pinOrUnpinUser(App\Request $request): void

Spaces must be used for alignment; tabs are not allowed
Open

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

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

    use \App\Controller\ExposeMethod;

Spaces must be used for alignment; tabs are not allowed
Open

        $this->exposeMethod('getEvents');

Spaces must be used for alignment; tabs are not allowed
Open

        $response = new Vtiger_Response();

Spaces must be used for alignment; tabs are not allowed
Open

        $record->set('types', $request->getArray('types', 'Text'));

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('customFilter', $request->getInteger('cvid'));

Spaces must be used for alignment; tabs are not allowed
Open

        return $record;

Spaces must be used for alignment; tabs are not allowed
Open

     * Update event.

Spaces must be used for alignment; tabs are not allowed
Open

            $id = $request->getInteger('element_id');

Spaces must be used for alignment; tabs are not allowed
Open

                    $result = 'pin';

Spaces must be used for alignment; tabs are not allowed
Open

        $this->exposeMethod('getCountEventsGroup');

Spaces must be used for alignment; tabs are not allowed
Open

        $response->setResult($entity);

Spaces must be used for alignment; tabs are not allowed
Open

        $response->emit();

Spaces must be used for alignment; tabs are not allowed
Open

     * Get count Events for extended calendar's left column.

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

                $users = Vtiger_CalendarRightPanel_Model::getFavoriteUsers($request->getModule());

Spaces must be used for alignment; tabs are not allowed
Open

 * @author        Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

                    $db->createCommand()->insert('u_#__users_pinned', [

Spaces must be used for alignment; tabs are not allowed
Open

                } else {

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

        $record = $this->getCalendarModel($request);

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

                    ])->execute();

Spaces must be used for alignment; tabs are not allowed
Open

        if ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\App\Privilege::isPermitted($moduleName, 'EditView', $request->getInteger('id')))) {

Spaces must be used for alignment; tabs are not allowed
Open

        $entity = array_merge($record->getEntity(), $record->getPublicHolidays());

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('end', App\Fields\DateTime::formatToDisplay($datePair[1] . ' 23:59:59'));

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

        if ($request->has('cvid')) {

Spaces must be used for alignment; tabs are not allowed
Open

        $record = Vtiger_Calendar_Model::getInstance($request->getModule());

Spaces must be used for alignment; tabs are not allowed
Open

        $success = $record->updateEvent($request->getInteger('id'), $request->getByType('start', 'dateTimeInUserFormat'), $request->getByType('end', 'dateTimeInUserFormat'), $request);

Spaces must be used for alignment; tabs are not allowed
Open

     * Get count Events for extended calendar's left column.

Spaces must be used for alignment; tabs are not allowed
Open

        $userId = \App\User::getCurrentUserId();

Spaces must be used for alignment; tabs are not allowed
Open

            }

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

     * Function to check permission.

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('start', App\Fields\DateTime::formatToDisplay($datePair[0] . ' 00:00:00'));

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

        $record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('end', $request->getByType('end', 'DateInUserFormat'));

Spaces must be used for alignment; tabs are not allowed
Open

            $record->set('filters', $request->getByType('filters', 'Alnum'));

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

                    $result = 'unpin';

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

     * @return void

Spaces must be used for alignment; tabs are not allowed
Open

            if (\App\User::isExists($id)) {

Spaces must be used for alignment; tabs are not allowed
Open

                        'tabid' => \App\Module::getModuleId($request->getModule()),

Spaces must be used for alignment; tabs are not allowed
Open

                        'fav_id' => $id,

Spaces must be used for alignment; tabs are not allowed
Open

        $response = new Vtiger_Response();

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

 * @license     YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)

Spaces must be used for alignment; tabs are not allowed
Open

 * @author       Radosław Skrzypczak <r.skrzypczak@yetiforce.com>

Spaces must be used for alignment; tabs are not allowed
Open

        $moduleName = $request->getModule();

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

    public function getCountEventsGroup(App\Request $request)

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

            $result[] = $record->getEntityRecordsCount();

Spaces must be used for alignment; tabs are not allowed
Open

        $response->setResult($result);

Spaces must be used for alignment; tabs are not allowed
Open

     * @param App\Request $request

Spaces must be used for alignment; tabs are not allowed
Open

        $response = new Vtiger_Response();

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

 * @copyright     YetiForce S.A.

Spaces must be used for alignment; tabs are not allowed
Open

    public function checkPermission(App\Request $request)

Spaces must be used for alignment; tabs are not allowed
Open

        if (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {

Spaces must be used for alignment; tabs are not allowed
Open

        $this->exposeMethod('pinOrUnpinUser');

Spaces must be used for alignment; tabs are not allowed
Open

        $response = new Vtiger_Response();

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

        $record = Vtiger_Calendar_Model::getInstance($request->getModule());

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

    public function updateEvent(App\Request $request)

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

     *

Spaces must be used for alignment; tabs are not allowed
Open

                    $db->createCommand()->delete('u_#__users_pinned', ['id' => $users[$id]])->execute();

Spaces must be used for alignment; tabs are not allowed
Open

                \App\Cache::delete('FavoriteUsers', $userId);

Spaces must be used for alignment; tabs are not allowed
Open

        $this->exposeMethod('updateEvent');

Spaces must be used for alignment; tabs are not allowed
Open

        $result = [];

Spaces must be used for alignment; tabs are not allowed
Open

    /**

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

    {

Spaces must be used for alignment; tabs are not allowed
Open

        if (!$request->isEmpty('element_id')) {

Spaces must be used for alignment; tabs are not allowed
Open

    public function __construct()

Spaces must be used for alignment; tabs are not allowed
Open

        $record = $this->getCalendarModel($request);

Spaces must be used for alignment; tabs are not allowed
Open

     */

Spaces must be used for alignment; tabs are not allowed
Open

        if ($request->has('start') && $request->has('end')) {

Spaces must be used for alignment; tabs are not allowed
Open

        if ($request->has('filters')) {

Spaces must be used for alignment; tabs are not allowed
Open

    }

Spaces must be used for alignment; tabs are not allowed
Open

        $response->setResult($success);

Spaces must be used for alignment; tabs are not allowed
Open

        }

Spaces must be used for alignment; tabs are not allowed
Open

                }

Spaces must be used for alignment; tabs are not allowed
Open

        $response->setResult($result);

Spaces must be used for alignment; tabs are not allowed
Open

        $response->emit();

Line exceeds 120 characters; contains 172 characters
Open

        if ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\App\Privilege::isPermitted($moduleName, 'EditView', $request->getInteger('id')))) {

Line exceeds 120 characters; contains 158 characters
Open

        if (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {

Line exceeds 120 characters; contains 184 characters
Open

        $success = $record->updateEvent($request->getInteger('id'), $request->getByType('start', 'dateTimeInUserFormat'), $request->getByType('end', 'dateTimeInUserFormat'), $request);

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

class Vtiger_Calendar_Action extends \App\Controller\Action

There are no issues that match your filters.

Category
Status