Function getMenu
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
{
$selectedFieldId = 0;
$selectedBlockId = 0;
$menu = [];
- 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
Method getMenu
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
{
$selectedFieldId = 0;
$selectedBlockId = 0;
$menu = [];
Function getSelectedFieldFromModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getSelectedFieldFromModule(string $moduleName): ?Settings_Vtiger_MenuItem_Model
{
foreach (self::getAll() as $menuModel) {
foreach ($menuModel->getMenuItems() as $menuItem) {
if ($menuItem->getParam('module') === $moduleName && $menuItem->isPermitted()) {
- 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 method getMenu() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10. Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
{
$selectedFieldId = 0;
$selectedBlockId = 0;
$menu = [];
- Read upRead up
- Exclude checks
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
Refactor this function to reduce its Cognitive Complexity from 28 to the 15 allowed. Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Missing class import via use statement (line '207', column '19'). Open
$rowData = (new App\Db\Query())
- 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 '156', column '23'). Open
$dataReader = (new App\Db\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- 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\Purifier' in method 'getUrl'. Open
return App\Purifier::decodeHtml((string) $this->get('linkto'));
- 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 'getAll'. Open
if (!\App\Cache::has($cacheName, $key)) {
- 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\Language' in method 'getMenu'. Open
'name' => \App\Language::translate($menuModel->getLabel(), 'Settings::Vtiger'),
- 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 'clearCache'. Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::ACTIVE);
- 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\Security\AdminAccess' in method 'isPermitted'. Open
return (empty($this->getParam('module')) || \App\Security\AdminAccess::isPermitted($this->getParam('module'), $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 '\App\Language' in method 'getMenu'. Open
'name' => \App\Language::translate($menuModel->getLabel(), 'Settings::Vtiger'),
- 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 'clearCache'. Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::INACTIVE);
- 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 'getAll'. Open
return \App\Cache::get($cacheName, $key);
- 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\Language' in method 'getMenu'. Open
$children[$fieldId]['addonIconTitle'] = App\Language::translate('LBL_PAID_FUNCTIONALITY');
- 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 'clearCache'. Open
\App\Cache::delete('MenuAll', '');
- 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 getMenu uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
if (!$selectedBlockId && $menuModel->isSelected($moduleName, $view, $mode)) {
$selectedBlockId = $blockId;
}
$menu[$blockId] = [
- 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 assigning values to variables in if clauses and the like (line '292', column '60'). Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
{
$selectedFieldId = 0;
$selectedBlockId = 0;
$menu = [];
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'getMenu'. Open
'name' => \App\Language::translate($menuItem->get('name'), $menuItem->getModuleName()),
- 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 'getAll'. Open
\App\Cache::save($cacheName, $key, $menuModels);
- 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 'isPermitted'. Open
$userId = $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 '\vtlib\Functions' in method 'getParam'. Open
$this->params = \vtlib\Functions::getQueryParams($this->getUrl());
- 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 'Settings_Vtiger_MenuItem_Model' in method 'getMenuItems'. Open
return Settings_Vtiger_MenuItem_Model::getAll($this->getId());
- 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 "moduleName" 3 times. Open
'moduleName' => $menuItem->getModuleName(),
- 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 "sequence" 7 times. Open
$dataReader = (new App\Db\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- 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 "Settings::Vtiger" 4 times. Open
'name' => \App\Language::translate($menuModel->getLabel(), 'Settings::Vtiger'),
- 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 "module" 4 times. Open
return $this->getParam('view') === $view && $this->getParam('module') === $moduleName && $this->getParam('mode') === $mode;
- 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 "active" 5 times. Open
'active' => $selectedFieldId === $menuItem->getId(),
- 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.
Remove this unused "TYPE_LINK" private field. Open
private const TYPE_LINK = 1;
- Read upRead up
- Exclude checks
If a private
field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will
improve maintainability because developers will not wonder what the variable is used for.
Noncompliant Code Example
class MyClass { private $foo = 4; //foo is unused public function compute($a) { return $a * 4; } }
Compliant Solution
class MyClass { public function compute($a) { return $a * 4; } }
See
- CERT, MSC12-CPP. - Detect and remove code that has no effect
Call to undeclared method \App\Db\Query::from
Open
$rowData = (new App\Db\Query())
- Exclude checks
Argument 2 (key)
is 0
but \App\Cache::delete()
takes string
defined at /code/app/Cache.php:105
Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::ACTIVE);
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
$userId = $userId ?: \App\User::getCurrentUserId();
- Exclude checks
Assigning false
to property but \Settings_Vtiger_Menu_Model::$cacheInstance
is array
Open
public static $cacheInstance = false;
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_vtiger_menu_model> instance'</settings_vtiger_menu_model>
Open
* @return <Settings_Vtiger_Menu_Model> instance
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_vtiger_menu_model> instance'</settings_vtiger_menu_model>
Open
* @return <Settings_Vtiger_Menu_Model> instance
- Exclude checks
Argument 2 (key)
is 1
but \App\Cache::delete()
takes string
defined at /code/app/Cache.php:105
Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::INACTIVE);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$dataReader = (new App\Db\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Vtiger_Menu_Model extends \App\Base
- Exclude checks
The class Settings_Vtiger_Menu_Model is not named in CamelCase. Open
class Settings_Vtiger_Menu_Model extends \App\Base
{
/**
* Menu type: Label.
*/
- 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 $id. Configured minimum length is 3. Open
public static function getInstanceById(int $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 to indent lines; tabs are not allowed Open
* Menu type: Link.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $menusTable = 'vtiger_settings_blocks';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Menu type: Label.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private const TYPE_LINK = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the Id of the Menu Model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array Parses the URL into variables
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $params;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private const TYPE_LABEL = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected static $menuId = 'blockid';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return App\Purifier::decodeHtml((string) $this->get('linkto'));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
&& (empty($this->get('admin_access')) || false !== strpos($this->get('admin_access'), ",{$userId},"));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $key
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!isset($this->params)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getSelectedFieldFromModule(string $moduleName): ?Settings_Vtiger_MenuItem_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static Function to get the instance of Settings Menu model for the given menu name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $name - Menu Name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedBlockId = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$children[$fieldId] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => $menuModel->get('icon'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedBlockId = $blockId;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::ACTIVE);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return int - Menu Id
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string - Menu Label
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('type');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->params = \vtlib\Functions::getQueryParams($this->getUrl());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return Settings_Vtiger_MenuItem_Model::getAll($this->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Settings_Vtiger_Menu_Model[]
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
$dataReader = (new App\Db\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selected = $menuItem;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getId()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string - Menu Label
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check permission.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets menu element by module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Settings_Vtiger_Menu_Model|null
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$children[$fieldId]['addonIconTitle'] = App\Language::translate('LBL_PAID_FUNCTIONALITY');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => 'Label',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => $menuModel->get('icon'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $view
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$cacheName = 'MenuAll';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menuModels[$blockId] = self::getInstanceFromArray($rowData);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $valueMap
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from(self::$menusTable)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($rowData) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets menu elements.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'parent' => 'Settings',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'moduleName' => $menuItem->getModuleName(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($menuItem->get('premium')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sequence' => $menuModel->get('sequence'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
return (empty($this->getParam('module')) || \App\Security\AdminAccess::isPermitted($this->getParam('module'), $userId))
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::getAll() as $menuModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'newwindow' => '0',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'moduleName' => 'Settings::Vtiger',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'newwindow' => '0',
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
if (0 === $selectedFieldId && 0 === $selectedBlockId && ($selected = self::getSelectedFieldFromModule($moduleName))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = (new App\Db\Query())->from(self::$menusTable)->orderBy(['sequence' => SORT_ASC])->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::save($cacheName, $key, $menuModels);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Array with instances, kay as number id element of menu.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $id
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstance($name)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (self::getAll() as $blockId => $menuModel) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($menuModel->getMenuItems() as $fieldId => $menuItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'id' => $menuItem->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'active' => $selectedBlockId === $blockId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$selectedBlockId && $menuModel->isSelected($moduleName, $view, $mode)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function clearCache(): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the menu label.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$userId = $userId ?: \App\User::getCurrentUserId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($menuModel->getMenuItems() as $menuItem) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromArray($valueMap)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Settings_Vtiger_Menu_Model> instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menu[$blockId] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menu[$blockId] = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get(self::$menuId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string - Menu Item landing url
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if the menu item has been selected.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\App\Cache::has($cacheName, $key)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($rowData = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->limit(1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::getInstanceFromArray($rowData);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $view
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menu = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$menuModel->isPermitted()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$children = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => 'Shortcut',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$children[$fieldId]['addonIcon'] = 'yfi-premium color-yellow-600';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'id' => $blockId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getLabel()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Line exceeds 120 characters; contains 131 characters Open
return $this->getParam('view') === $view && $this->getParam('module') === $moduleName && $this->getParam('mode') === $mode;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static Function to get the instance of Settings Menu model with the given value map array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $mode
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedFieldId = $menuItem->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Clear cache.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->getParam('view') === $view && $this->getParam('module') === $moduleName && $this->getParam('mode') === $mode;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $userId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->params[$key] ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($menuItem->getParam('module') === $moduleName && $menuItem->isPermitted()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getAll(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @var array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'active' => $selectedFieldId === $menuItem->getId(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'active' => $selectedBlockId === $blockId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::delete('MenuItemAll', \Settings_Vtiger_MenuItem_Model::INACTIVE);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the menu type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $mode
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function returns menu items for the current menu.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockId = (int) $rowData[self::$menuId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $cacheInstance = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return self::getAll()[$id] ?? null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 === $selectedFieldId && 0 === $selectedBlockId && ($selected = self::getSelectedFieldFromModule($moduleName))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $menu;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the url to get to the Settings Menu Block.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isPermitted(int $userId = 0): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getParam(string $key): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getMenuItems()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Settings_Vtiger_MenuItem_Model|null
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $menuItem;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedBlockId = $menuItem->getBlockId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sequence' => $menuModel->get('sequence'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'childs' => $children,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dataurl' => $menuModel->getUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets data from URL.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$rowData = (new App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$menuItem->isPermitted()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dataurl' => $menuItem->getUrl(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => 'Shortcut',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Settings_Vtiger_MenuItem_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$key = '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menuModels = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \App\Cache::get($cacheName, $key);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Settings_Vtiger_Menu_Model> instance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['label' => $name])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => \App\Language::translate($menuItem->get('name'), $menuItem->getModuleName()),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => \App\Language::translate($menuModel->getLabel(), 'Settings::Vtiger'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => \App\Language::translate($menuModel->getLabel(), 'Settings::Vtiger'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'moduleName' => 'Settings::Vtiger',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menu[$selected->getBlockId()]['childs'][$selected->getId()]['active'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
continue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$selectedBlockId && $menuItem->isSelected($moduleName, $view, $mode)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'sequence' => $menuItem->get('sequence'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$menu[$selected->getBlockId()]['active'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getUrl()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isSelected(string $moduleName, string $view, string $mode = ''): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (empty($this->getParam('module')) || \App\Security\AdminAccess::isPermitted($this->getParam('module'), $userId))
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Static function to get the list of all the Settings Menus.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return new self($valueMap);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets block instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceById(int $id)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed|null $selected
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$selectedFieldId = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (self::TYPE_LABEL === (int) $menuModel->getType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'icon' => $menuItem->get('iconpath'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'id' => $blockId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::delete('MenuAll', '');
- Exclude checks
Class name "Settings_Vtiger_Menu_Model" is not in camel caps format Open
class Settings_Vtiger_Menu_Model extends \App\Base
- Exclude checks