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')) {
- Read upRead up
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;
/**
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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')))) {
- Read upRead up
- Exclude checks
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'));
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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);
- Read upRead up
- Exclude checks
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());
- Read upRead up
- Exclude checks
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'));
- Read upRead up
- Exclude checks
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';
}
- Read upRead up
- Exclude checks
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)) {
- Read upRead up
- Exclude checks
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()),
- Read upRead up
- Exclude checks
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'));
- Read upRead up
- Exclude checks
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')) {
- Read upRead up
- Exclude checks
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', [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('u_#__users_pinned', ['id' => $users[$id]])->execute();
- Exclude checks
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')) {
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = \App\User::getCurrentUserId();
- Exclude checks
Call to method isExists
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\User::isExists($id)) {
- Exclude checks
Call to method getFavoriteUsers
from undeclared class \Vtiger_CalendarRightPanel_Model
Open
$users = Vtiger_CalendarRightPanel_Model::getFavoriteUsers($request->getModule());
- Exclude checks
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
- Exclude checks
The class Vtiger_Calendar_Action is not named in CamelCase. Open
class Vtiger_Calendar_Action extends \App\Controller\Action
{
use \App\Controller\ExposeMethod;
/**
- Read upRead up
- Exclude checks
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();
- Read upRead up
- Exclude checks
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');
- Read upRead up
- Exclude checks
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
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function getCalendarModel(App\Request $request): Vtiger_Calendar_Model
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @throws \App\Exceptions\NoPermitted
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->emit();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return Vtiger_Calendar_Model
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'user_id' => $userId,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function getEvents(App\Request $request)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$request->delete('end');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->exposeMethod('getEventsYear');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param App\Request $request
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('user', $request->getArray('user', 'Alnum'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->emit();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param App\Request $request
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (empty($users[$id])) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
parent::__construct();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
foreach ($request->getArray('dates', 'date') as $datePair) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Get calendar model.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('start', $request->getByType('start', 'DateInUserFormat'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function pinOrUnpinUser(App\Request $request): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
use \App\Controller\ExposeMethod;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->exposeMethod('getEvents');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response = new Vtiger_Response();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('types', $request->getArray('types', 'Text'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('customFilter', $request->getInteger('cvid'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
return $record;
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Update event.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$id = $request->getInteger('element_id');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$result = 'pin';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->exposeMethod('getCountEventsGroup');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->setResult($entity);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->emit();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Get count Events for extended calendar's left column.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$users = Vtiger_CalendarRightPanel_Model::getFavoriteUsers($request->getModule());
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @author Mariusz Krzaczkowski <m.krzaczkowski@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$db->createCommand()->insert('u_#__users_pinned', [
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record = $this->getCalendarModel($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
])->execute();
- Exclude checks
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')))) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$entity = array_merge($record->getEntity(), $record->getPublicHolidays());
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('end', App\Fields\DateTime::formatToDisplay($datePair[1] . ' 23:59:59'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($request->has('cvid')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record = Vtiger_Calendar_Model::getInstance($request->getModule());
- Exclude checks
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);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Get count Events for extended calendar's left column.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$userId = \App\User::getCurrentUserId();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* Function to check permission.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('start', App\Fields\DateTime::formatToDisplay($datePair[0] . ' 00:00:00'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('time', $request->isEmpty('time') ? '' : $request->getByType('time'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('end', $request->getByType('end', 'DateInUserFormat'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record->set('filters', $request->getByType('filters', 'Alnum'));
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$result = 'unpin';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (\App\User::isExists($id)) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'tabid' => \App\Module::getModuleId($request->getModule()),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'fav_id' => $id,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response = new Vtiger_Response();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @license YetiForce Public License 6.5 (licenses/LicenseEN.txt or yetiforce.com)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @author Radosław Skrzypczak <r.skrzypczak@yetiforce.com>
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function getCountEventsGroup(App\Request $request)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$result[] = $record->getEntityRecordsCount();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->setResult($result);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @param App\Request $request
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response = new Vtiger_Response();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @copyright YetiForce S.A.
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function checkPermission(App\Request $request)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->exposeMethod('pinOrUnpinUser');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response = new Vtiger_Response();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record = Vtiger_Calendar_Model::getInstance($request->getModule());
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function updateEvent(App\Request $request)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$db->createCommand()->delete('u_#__users_pinned', ['id' => $users[$id]])->execute();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
\App\Cache::delete('FavoriteUsers', $userId);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->exposeMethod('updateEvent');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$result = [];
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!$request->isEmpty('element_id')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function __construct()
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$record = $this->getCalendarModel($request);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($request->has('start') && $request->has('end')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if ($request->has('filters')) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->setResult($success);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->setResult($result);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$response->emit();
- Exclude checks
Line exceeds 120 characters; contains 172 characters Open
if ('updateEvent' === $request->getMode() && ($request->isEmpty('id', true) || !\App\Privilege::isPermitted($moduleName, 'EditView', $request->getInteger('id')))) {
- Exclude checks
Line exceeds 120 characters; contains 158 characters Open
if (!$userPrivilegesModel->hasModulePermission($moduleName) || !\method_exists(Vtiger_Module_Model::getInstance($moduleName), 'getCalendarViewUrl')) {
- Exclude checks
Line exceeds 120 characters; contains 184 characters Open
$success = $record->updateEvent($request->getInteger('id'), $request->getByType('start', 'dateTimeInUserFormat'), $request->getByType('end', 'dateTimeInUserFormat'), $request);
- Exclude checks
Class name "Vtiger_Calendar_Action" is not in camel caps format Open
class Vtiger_Calendar_Action extends \App\Controller\Action
- Exclude checks