File ModuleBasic.php
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
ModuleBasic
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
The class ModuleBasic has an overall complexity of 71 which is very high. The configured complexity threshold is 50. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
- Exclude checks
The class ModuleBasic has 23 public methods. Consider refactoring ModuleBasic to keep number of public methods under 10. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
Method __create
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __create()
{
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
$db = \App\Db::getInstance();
The class ModuleBasic has 21 fields. Consider redesigning ModuleBasic to keep the number of fields under 15. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Function deleteModuleTables
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function deleteModuleTables()
{
\App\Log::trace('Start', __METHOD__);
$db = \App\Db::getInstance();
$db->createCommand()->checkIntegrity(false)->execute();
- 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
Function __create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __create()
{
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
$db = \App\Db::getInstance();
- 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 delete
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete()
{
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
$focus = \CRMEntity::getInstance($this->name);
if (isset($focus->table_name)) {
The class ModuleBasic has 49 public methods and attributes. Consider reducing the number of public items to less than 45. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
Method initTables
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initTables($basetable = false, $basetableid = false)
{
$this->basetable = $basetable;
$this->basetableid = $basetableid;
$db = \App\Db::getInstance();
Method setEntityIdentifier
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setEntityIdentifier(FieldBasic $fieldInstance)
{
$db = \App\Db::getInstance();
if ($this->basetableid) {
Function setEntityIdentifier
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function setEntityIdentifier(FieldBasic $fieldInstance)
{
$db = \App\Db::getInstance();
if ($this->basetableid) {
- 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
Function deleteIcons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteIcons()
{
\App\Log::trace('Start', __METHOD__);
$iconSize = ['', 48, 64, 128];
$layouts = array_keys(\App\Layout::getAllLayouts());
- 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
Class "ModuleBasic" has 28 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class ModuleBasic
- Read upRead up
- Exclude checks
A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.
The class ModuleBasic has a coupling between objects value of 26. Consider to reduce the number of dependencies under 13. Open
class ModuleBasic
{
/** ID of this instance */
public $id = false;
public $name = false;
- 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 '120', column '21'). Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
- 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
The method initTables has a boolean flag argument $basetableid, which is a certain sign of a Single Responsibility Principle violation. Open
public function initTables($basetable = false, $basetableid = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '108', column '21'). Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- 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 '443', column '21'). Open
$relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
- 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 '482', column '17'). Open
$query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->name]);
- 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 '253', column '19'). Open
$importer = new \App\Db\Importers\Base();
- 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
Remove error control operator '@' on line 560. Open
public function deleteIcons()
{
\App\Log::trace('Start', __METHOD__);
$iconSize = ['', 48, 64, 128];
$layouts = array_keys(\App\Layout::getAllLayouts());
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method initTables has a boolean flag argument $basetable, which is a certain sign of a Single Responsibility Principle violation. Open
public function initTables($basetable = false, $basetableid = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getFields has a boolean flag argument $blockInstance, which is a certain sign of a Single Responsibility Principle violation. Open
public function getFields($blockInstance = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '288', column '21'). Open
$isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
- 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 '\CRMEntity' in method 'delete'. Open
$focus = \CRMEntity::getInstance($this->name);
- 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\Block' in method 'delete'. Open
Block::deleteForModule($this);
- 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\Log' in method '__create'. Open
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
- 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 '__create'. Open
\App\Module::createModuleMetaFile();
- 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\Log' in method '__delete'. Open
\App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
- 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 'initialize'. Open
$entitydata = \App\Module::getEntityInfo($this->name);
- 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\Profile' in method '__create'. Open
Profile::initForModule($this);
- 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\Log' in method '__update'. Open
\App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
- 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\Access' in method 'delete'. Open
Access::deleteSharing($moduleInstance);
- 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 'initTables'. 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 'vtlib\Access' in method 'setDefaultSharing'. Open
Access::setDefaultSharing($this, $permission_text);
- 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\Log' in method 'unsetAllRelatedList'. Open
\App\Log::trace('End', __METHOD__);
- 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\Layout' in method 'deleteDir'. Open
foreach (\App\Layout::getAllLayouts() as $name => $label) {
- 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 'deleteDir'. Open
Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
- 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\Layout' in method 'deleteIcons'. Open
$layouts = array_keys(\App\Layout::getAllLayouts());
- 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\Access' in method 'disallowSharing'. Open
Access::allowSharing($this, false);
- 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 getFields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$fields = Field::getAllForModule($this);
}
- 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 '\Vtiger_Module_Model' in method 'deleteModuleTables'. Open
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
- 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 __create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$db->createCommand()->insert('vtiger_tab_info', [
'tabid' => $this->id,
'prefname' => 'vtiger_max_version',
'prefvalue' => $this->maxversion,
- 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\Log' in method '__updateVersion'. Open
\App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
- 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\Filter' in method 'delete'. Open
Filter::deleteForModule($this);
- 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\Field' in method 'getFields'. Open
$fields = Field::getAllForModule($this);
- 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 'deleteDir'. Open
Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
- 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 __create uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$db->createCommand()->insert('vtiger_tab_info', [
'tabid' => $this->id,
'prefname' => 'vtiger_min_version',
'prefvalue' => $this->minversion,
- 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 'vtlib\Access' in method 'delete'. Open
Access::deleteTools($this);
- 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\Access' in method 'disableTools'. Open
Access::updateTool($this, $tool, false);
- 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\Field' in method 'getFields'. Open
$fields = Field::getAllForBlock($blockInstance, $this);
- 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\Relation' in method 'unsetAllRelatedList'. Open
\App\Relation::clearCacheByModule($this->name, false);
- 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\Log' in method 'deleteFromCRMEntity'. Open
\App\Log::trace('Start', __METHOD__);
- 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 'initTables'. 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 'vtlib\Link' in method 'getLinksForExport'. Open
return Link::getAllForExport($this->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 'vtlib\Functions' in method 'deleteDir'. Open
Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
- 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 'deleteDir'. Open
Functions::recurseDelete('modules/Settings/' . $moduleInstance->name);
- 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 'deleteDir'. Open
Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
- 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 '__create'. 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 'vtlib\Access' in method '__create'. Open
Access::initSharing($this);
- 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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->__create();
}
- 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 'vtlib\Cron' in method 'delete'. Open
Cron::deleteForModule($moduleInstance);
- 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 'delete'. Open
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
- 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_Module_Model' in method 'delete'. Open
\Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
- 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\Log' in method 'unsetAllRelatedList'. Open
\App\Log::trace('Start', __METHOD__);
- 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\Log' in method 'unsetEntityIdentifier'. Open
\App\Log::trace('Unsetting entity identifier ... DONE', __METHOD__);
- 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 'deleteDir'. Open
Functions::recurseDelete('modules/' . $moduleInstance->name);
- 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\Log' in method 'deleteFromCRMEntity'. Open
\App\Log::trace('End', __METHOD__);
- 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 'deleteModuleTables'. 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 '\App\Log' in method 'setEntityIdentifier'. Open
\App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
- 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\Relation' in method 'unsetAllRelatedList'. Open
\App\Relation::clearCacheById((int) $id, false);
- 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_Record_Model' in method 'deleteFromCRMEntity'. Open
$recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->name);
- 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\Menu' in method 'delete'. Open
Menu::deleteForModule($moduleInstance);
- 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 'setEntityIdentifier'. 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 'vtlib\Access' in method 'allowSharing'. Open
Access::allowSharing($this, true);
- 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\Log' in method 'deleteIcons'. Open
\App\Log::trace('Start', __METHOD__);
- 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\Log' in method 'deleteIcons'. Open
\App\Log::trace('End', __METHOD__);
- 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\Log' in method '__create'. Open
\App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
- 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\Module' in method '__delete'. Open
Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
- 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 'delete'. Open
\App\Cache::clear();
- 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\Log' in method 'deleteModuleTables'. Open
\App\Log::trace('Start', __METHOD__);
- 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\Log' in method 'deleteDir'. Open
\App\Log::trace('Start', __METHOD__);
- 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\Language' in method 'delete'. Open
Language::deleteForModule($moduleInstance);
- 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 'delete'. Open
\App\Module::createModuleMetaFile();
- 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\Tree' in method 'delete'. Open
\App\Fields\Tree::deleteForModule($this->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 'vtlib\Link' in method 'delete'. Open
Link::deleteAll($this->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\Log' in method 'setEntityIdentifier'. Open
\App\Log::trace('Setting entity identifier ... DONE', __METHOD__);
- 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_Workflows_Module_Model' in method 'delete'. Open
\Settings_Workflows_Module_Model::deleteForModule($moduleInstance);
- 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\Log' in method 'deleteModuleTables'. Open
\App\Log::trace('End', __METHOD__);
- 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 setEntityIdentifier uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
\App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
}
- 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 'vtlib\Access' in method 'enableTools'. Open
Access::updateTool($this, $tool, true);
- 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\Relation' in method 'unsetAllRelatedList'. Open
\App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
- 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\Profile' in method 'delete'. Open
Profile::deleteForModule($this);
- 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 'unsetAllRelatedList'. 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 '\App\Module' in method 'unsetAllRelatedList'. Open
\App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
- 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 'deleteDir'. Open
Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
- 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\Log' in method 'deleteDir'. Open
\App\Log::trace('End', __METHOD__);
- 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 "tabsequence" 3 times. Open
$this->tabsequence = (int) $valuemap['tabsequence'];
- 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 "vtiger_min_version" 3 times. Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- 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 "prefname" 6 times. Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- 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 "vtiger_max_version" 3 times. Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
- 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 "tablename" 4 times. Open
$this->basetable = $entitydata['tablename'];
- 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 "prefvalue" 4 times. Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
- 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 "entityidfield" 3 times. Open
$this->basetableid = $entitydata['entityidfield'];
- 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 "relation_id" 3 times. Open
$relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
- 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 "vtiger_entityname" 4 times. Open
$isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
- 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 "Start" 5 times. Open
\App\Log::trace('Start', __METHOD__);
- 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 "vtiger_tab_info" 6 times. Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- 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 "vtiger_tab" 5 times. Open
$this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
- 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 "tabid" 20 times. Open
$this->id = (int) $valuemap['tabid'];
- 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 "version" 3 times. Open
$this->version = $valuemap['version'];
- 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.
Avoid unused local variables such as '$label'. Open
foreach (\App\Layout::getAllLayouts() as $name => $label) {
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
Assigning int
to property but \vtlib\ModuleBasic->id
is false
Open
$this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- Exclude checks
Argument 1 (moduleId)
is false
but \App\Fields\Tree::deleteForModule()
takes int
defined at /code/app/Fields/Tree.php:169
Open
\App\Fields\Tree::deleteForModule($this->id);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
- Exclude checks
Assigning int
to property but \vtlib\ModuleBasic->tabsequence
is false
Open
$this->tabsequence = (int) $valuemap['tabsequence'];
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_relatedlists_fields', ['relation_id' => $ids])->execute();
- Exclude checks
Argument 1 (mixed)
is false
but \Vtiger_Module_Model::getInstance()
takes int|string
defined at /code/modules/Vtiger/models/Module.php:197
Open
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('vtiger_tab_info', [
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->name]);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('vtiger_tab_info', [
- Exclude checks
Reference to undeclared property \CRMEntity->table_name
Open
if (isset($focus->table_name)) {
- Exclude checks
Reference to undeclared property \CRMEntity->table_name
Open
$this->tableName = $focus->table_name;
- Exclude checks
Assigning 'cf'
to property but \vtlib\ModuleBasic->customtable
is false
Open
$this->customtable = $this->basetable . 'cf';
- Exclude checks
Argument 1 (tableName)
is false
but \App\Db::createTable()
takes string
defined at /code/app/Db.php:331
Open
$db->createTable($this->basetable, [
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Unsetting entity identifier ... DONE', __METHOD__);
- Exclude checks
Argument 1 (moduleName)
is false
but \App\Relation::clearCacheByModule()
takes string
defined at /code/app/Relation.php:129
Open
\App\Relation::clearCacheByModule($this->name, false);
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete('modules/Settings/' . $moduleInstance->name);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('vtiger_tab', [
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
$db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
- Exclude checks
Assigning int
to property but \vtlib\ModuleBasic->id
is false
Open
$this->id = (int) $valuemap['tabid'];
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
- Exclude checks
Argument 2 (module)
is false
but \Vtiger_Record_Model::getInstanceById()
takes string
defined at /code/modules/Vtiger/models/Record.php:763
Open
$recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->name);
- Exclude checks
Argument 1 (moduleName)
is false
but \App\Module::getEntityInfo()
takes ?string
defined at /code/app/Module.php:49
Open
$entitydata = \App\Module::getEntityInfo($this->name);
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
\App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
- Exclude checks
Argument 1 (mixed)
is false
but \Vtiger_Module_Model::getInstance()
takes int|string
defined at /code/modules/Vtiger/models/Module.php:197
Open
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
- Exclude checks
Default value for string
$basetable
can't be false
Open
public function initTables($basetable = false, $basetableid = false)
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
$db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->dropTable($tableName)->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->checkIntegrity(true)->execute();
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
\App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->delete('vtiger_modentity_num', ['tabid' => $this->id])->execute();
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
$fileName = ROOT_DIRECTORY . "/public_html/layouts/$name/images/{$this->name}{$value}.png";
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
$this->customtable = $this->basetable . 'cf';
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->delete('vtiger_group2modules', ['tabid' => $this->id])->execute();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->addForeignKey(
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete('modules/' . $moduleInstance->name);
- Exclude checks
Argument 1 (str)
is false
but \strtolower()
takes string
Open
$lcasemodname = strtolower($this->name);
- Exclude checks
Returning type false
but getId()
is declared to return int
Open
return $this->id;
- Exclude checks
Parameter $blockInstance
has undeclared type \vtlib\vtlib\Block
(Did you mean class \vtlib\Block) Open
public function getFields($blockInstance = false)
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('a_#__relatedlists_inv_fields', ['relation_id' => $ids])->execute();
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
\App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
- Exclude checks
Argument 1 (moduleName)
is false
but \Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule()
takes \type
defined at /code/modules/Settings/Vtiger/models/Module.php:162
Open
\Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
- Exclude checks
Argument 1 (tableName)
is false
but \App\Db::createTable()
takes string
defined at /code/app/Db.php:331
Open
$db->createTable($this->customtable, [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->dropTable($tableName)->execute();
- Exclude checks
Argument 1 (tabid)
is false
but \vtlib\Link::deleteAll()
takes int
defined at /code/vtlib/Vtiger/Link.php:146
Open
Link::deleteAll($this->id);
- Exclude checks
Default value for string
$basetableid
can't be false
Open
public function initTables($basetable = false, $basetableid = false)
- Exclude checks
Assigning string
to property but \vtlib\ModuleBasic->basetable
is false
Open
$this->basetable = 'u_' . $db->getConfig('base')['tablePrefix'] . $lcasemodname;
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->addForeignKey(
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Setting entity identifier ... DONE', __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->delete('vtiger_entityname', ['tabid' => $this->id])->execute();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
- Exclude checks
Suspicious type false
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->insert('vtiger_entityname', [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->checkIntegrity(false)->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
- Exclude checks
Argument 1 (module)
is false
but \CRMEntity::getInstance()
takes string
defined at /code/include/CRMEntity.php:61
Open
$focus = \CRMEntity::getInstance($this->name);
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
- Exclude checks
Assigning int
to property but \vtlib\ModuleBasic->isentitytype
is true
Open
$this->isentitytype = (int) $valuemap['isentitytype'];
- Exclude checks
Assigning int
to property but \vtlib\ModuleBasic->tabsequence
is false
Open
$this->tabsequence = $db->getUniqueID('vtiger_tab', 'tabsequence', false);
- Exclude checks
Assigning string
to property but \vtlib\ModuleBasic->version
is int
Open
$this->version = $newVersion;
- Exclude checks
Assigning string
to property but \vtlib\ModuleBasic->basetableid
is false
Open
$this->basetableid = $lcasemodname . 'id';
- Exclude checks
Default value for \vtlib\vtlib\Block
$blockInstance
can't be false
Open
public function getFields($blockInstance = false)
- Exclude checks
Call to method trace
from undeclared class \App\Log
Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($this->minversion) {
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
if ($isExists) {
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 134.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($this->maxversion) {
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
if ($isExists) {
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
} else {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 134.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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 $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
public $id = false;
- 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 $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 $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 $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
The parameter $permission_text is not named in camelCase. Open
public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
{
Access::setDefaultSharing($this, $permission_text);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Only one argument is allowed per line in a multi-line function call Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $presence = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $tabsequence = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $entityidfield = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $basetableid = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $id = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $maxversion = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $ownedby = 0; // 0 - Sharing Access Enabled, 1 - Sharing Access Disabled
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $customized = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $customtable = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** ID of this instance */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $version = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $parent = false;
- 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->label = $valuemap['tablabel'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->id = $db->getUniqueID('vtiger_tab', 'tabid', false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->label = $this->name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->minversion) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'prefvalue' => $this->maxversion,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- 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\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
- 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 $premium = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'presence' => $this->presence,
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'prefname' => 'vtiger_max_version',
- 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 ($this->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
- 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->deleteFromCRMEntity();
- 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->basetableid = $lcasemodname . 'id';
- 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
$isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabid' => $this->id,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'modulename' => $this->name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'entityidfield' => $this->entityidfield,
- 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
const EVENT_MODULE_DISABLED = 'module.disabled';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const EVENT_MODULE_POSTINSTALL = 'module.postinstall';
- 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->ownedby = $valuemap['ownedby'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->isentitytype || 'Users' === $this->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
* Update this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Link::deleteAll($this->id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $basetableid Base table column (default modulenameid in lowercase)
- 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 FieldBasic $fieldInstance
- Exclude checks
Line exceeds 120 characters; contains 262 characters Open
$db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
- 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 $minversion = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$entitydata = \App\Module::getEntityInfo($this->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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tablabel' => $this->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
public function __delete()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand = \App\Db::getInstance()->createCommand();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace("Deleting Module $this->name ... DONE", __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->deleteCRMEntityRel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function initTables($basetable = false, $basetableid = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$importer = new \App\Db\Importers\Base();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$isExists) {
- 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
const EVENT_MODULE_PREUNINSTALL = 'module.preuninstall';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const EVENT_MODULE_PREUPDATE = 'module.preupdate';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->presence = (int) $valuemap['presence'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->isentitytype = (int) $valuemap['isentitytype'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabsequence' => $this->tabsequence,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'customized' => $this->customized,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabid' => $this->id,
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace("Creating Module $this->name ... DONE", __METHOD__);
- 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
* Save this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Settings_Vtiger_Module_Model::deleteSettingsFieldBymodule($this->name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->deleteDir($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->addForeignKey(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set entity identifier field for this module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tablename' => $fieldInstance->table,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $label = false;
- 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
'version' => $this->version,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('vtiger_tab_info', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->delete('a_#__settings_modules', ['name' => $this->name])->execute();
- 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
if (!$this->basetableid) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->addForeignKey(
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Configure default sharing access for the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $isentitytype = true; // Real module or an extension?
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $basetable = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $type = 0;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->version = $valuemap['version'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'premium' => $this->premium,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->maxversion) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Profile::initForModule($this);
- 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 ($entitydata) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => $this->name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => $this->type,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabid' => $this->id,
- 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 __updateVersion($newVersion)
- Exclude checks
Line exceeds 120 characters; contains 133 characters Open
\App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__update();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __update()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->deleteIcons();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbCommand->delete('vtiger_tab', ['tabid' => $this->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->deleteModuleTables();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function delete()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createTable($this->basetable, [
- 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 (!$this->customtable) {
- 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->entityidfield = $this->basetableid;
- 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
'fieldname' => $fieldInstance->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
'sequence' => $this->id,
- 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\Log::trace('Setting entity identifier ... DONE', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_entityname', ['fieldname' => $fieldInstance->name, 'entityidfield' => $this->entityidfield, 'entityidcolumn' => $this->entityidcolumn], ['tabid' => $this->id, 'tablename' => $fieldInstance->table])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $grouptable = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const EVENT_MODULE_ENABLED = 'module.enabled';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->premium = (int) $valuemap['premium'];
- 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
* Create this module instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'isentitytype' => $this->isentitytype ? 1 : 0,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- 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
* Update module version information.
- 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
* Delete this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Block::deleteForModule($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Menu::deleteForModule($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Profile::deleteForModule($this);
- 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
$db->createTable($this->customtable, [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Line exceeds 120 characters; contains 175 characters Open
substr("fk_1_{$this->customtable}{$this->basetableid}", 0, 62), $this->customtable, $this->basetableid, $this->basetable, $this->basetableid, 'CASCADE', 'RESTRICT'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->entityidcolumn) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Updating entity identifier ... DONE', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $valuemap
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->id = (int) $valuemap['tabid'];
- 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 (!$this->label) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabid' => $this->id,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'parent' => $this->parent,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($isExists) {
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->maxversion], ['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Module::createModuleMetaFile();
- 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 save()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Fields\Tree::deleteForModule($this->id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Initialize tablename and index column names
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetable = 'u_' . $db->getConfig('base')['tablePrefix'] . $lcasemodname;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetableid => $importer->integer(10),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setEntityIdentifier(FieldBasic $fieldInstance)
- 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 ($this->entityidfield && $this->entityidcolumn) {
- 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 $name = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $tableName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Initialize this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->tabsequence = (int) $valuemap['tabsequence'];
- 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
Access::initSharing($this);
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Creates basetable, customtable, grouptable <br />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lcasemodname = strtolower($this->name);
- Exclude checks
Line exceeds 120 characters; contains 152 characters Open
$isExists = (new \App\Db\Query())->from('vtiger_entityname')->where(['tablename' => $fieldInstance->table, 'tabid' => $this->id])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Access::setDefaultSharing($this, $permission_text);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $entityidcolumn = false;
- 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
])->execute();
- Exclude checks
Line exceeds 120 characters; contains 148 characters Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('vtiger_tab_info', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Delete this instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->id;
- 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
* Initialize table required for the 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->entityidfield) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function unsetEntityIdentifier()
- 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\Db::getInstance()->createCommand()->delete('vtiger_entityname', ['tabid' => $this->id])->execute();
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
* @param string $permission_text Permission text should be one of ['Public_ReadWriteDelete', 'Public_ReadOnly', 'Public_ReadWrite', 'Private']
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Access::allowSharing($this, true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->parent = $valuemap['parent'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetable = $entitydata['tablename'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->tabsequence = $db->getUniqueID('vtiger_tab', 'tabsequence', false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $newVersion
- 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->version = $newVersion;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$focus = \CRMEntity::getInstance($this->name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($focus->table_name)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->tableName = $focus->table_name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Access::deleteSharing($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\Settings_Workflows_Module_Model::deleteForModule($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->deleteGroup2Modules();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Module::createModuleMetaFile();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->basetable) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
)->execute();
- 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
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->basetableid) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- 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
* @param string $permission_text Permission text should be one of ['Public_ReadWriteDelete', 'Public_ReadOnly', 'Public_ReadWrite', 'Private']
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetableid = $entitydata['entityidfield'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ownedby' => $this->ownedby,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
$db->createCommand()->update('vtiger_tab_info', ['prefvalue' => $this->minversion], ['tabid' => $this->id, 'prefname' => 'vtiger_min_version'])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'prefvalue' => $this->minversion,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$isExists = (new \App\Db\Query())->from('vtiger_tab_info')->where(['tabid' => $this->id, 'prefname' => 'vtiger_max_version'])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($isExists) {
- 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 ($this->isentitytype) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->unsetEntityIdentifier();
- 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
Access::deleteTools($this);
- 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->deleteFromModentityNum();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::clear();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* grouptable name is basetable + 'grouprel'<br />.
- 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
const EVENT_MODULE_POSTUPDATE = 'module.postupdate';
- 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 initialize($valuemap)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->name = $valuemap['name'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->type = (int) $valuemap['type'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->tabsequence) {
- 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
$this->basetable = $basetable;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetableid = $basetableid;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->basetableid => $importer->integer(10),
- Exclude checks
Line exceeds 120 characters; contains 162 characters Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->entityidcolumn = $this->basetableid;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('vtiger_entityname', [
- 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\Log::trace('Unsetting entity identifier ... DONE', __METHOD__);
- 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
Filter::deleteForModule($this);
- 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
* customtable name is basetable + 'cf'<br />
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $basetable Base table name (default modulename in lowercase)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->customtable = $this->basetable . 'cf';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
- 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
'entityidcolumn' => $this->entityidcolumn,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'searchcolumn' => $fieldInstance->name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Allow module sharing control.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function allowSharing()
- 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->customized = (int) $valuemap['customized'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function __create()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->insert('vtiger_tab', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'prefname' => 'vtiger_min_version',
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->__create();
- 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
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->unsetAllRelatedList();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Language::deleteForModule($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Cron::deleteForModule($moduleInstance);
- 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
$db->createCommand()->addPrimaryKey("{$this->basetable}_pk", $this->basetable, $this->basetableid)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
substr("fk_1_{$this->basetable}{$this->basetableid}", 0, 62), $this->basetable, $this->basetableid, 'vtiger_crmentity', 'crmid', 'CASCADE', 'RESTRICT'
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$db->createCommand()->addPrimaryKey("{$this->customtable}_pk", $this->customtable, $this->basetableid)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Unset entity identifier information.
- 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;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addFilter(Filter $filterInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = Field::getAllForBlock($blockInstance, $this);
- 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 disallowSharing()
- 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 $this->id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Unset related list information that exists with other module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_relatedlists_fields', ['relation_id' => $ids])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Relation::clearCacheByModule((string) \App\Module::getModuleName($tabId), false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Relation::clearCacheByModule($this->name, false);
- 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 remove rows in vtiger_group2modules table.
- 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
$query = (new \App\Db\Query())->select(['crmid'])->from('vtiger_crmentity')->where(['setype' => $this->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
* Disallow module sharing control.
- 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
* @param Filter $filterInstance
- 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
* Get all the custom links related to this module for exporting.
- 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
* Disable tools for this module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_string($tools)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add block to this 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
/**
- 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\Log::trace('End', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Db::getInstance()->createCommand()->delete('vtiger_group2modules', ['tabid' => $this->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove rows in vtiger_crmentityrel.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader = $query->createCommand()->query();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($crmId = $dataReader->readColumn(0)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function enableTools($tools)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Block $blockInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param vtlib\Block $blockInstance - Instance of block to use to get fields, false to get all the block fields
- Exclude checks
Line exceeds 120 characters; contains 213 characters Open
$relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Relation::clearCacheById((int) $id, false);
- 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 int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
- 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 (\is_string($tools)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tools = [$tools];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($blockInstance) {
- 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 getLinksForExport()
- 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 deleteGroup2Modules()
- 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
Access::updateTool($this, $tool, false);
- 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
$filterInstance->save($this);
- 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
*/
- 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 unsetAllRelatedList()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relations = (new \App\Db\Query())->select(['relation_id', 'tabid'])->from('vtiger_relatedlists')->where(['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->createCommand()->queryAllByGroup();
- 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
$recordModel = \Vtiger_Record_Model::getInstanceById($crmId, $this->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
}
- 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
$tools = [0 => $tools];
- 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
* Function to get the Module/Tab id.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFields($blockInstance = false)
- 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 Link::getAllForExport($this->id);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('a_#__relatedlists_inv_fields', ['relation_id' => $ids])->execute();
- 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
Line exceeds 120 characters; contains 155 characters Open
\App\Db::getInstance()->createCommand()->delete('vtiger_crmentityrel', ['or', ['module' => $this->name], ['relmodule' => $this->name]])->execute();
- 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|array $tools - String or Array with value ['Import', 'Export']
- 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
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($ids as $id) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function deleteCRMEntityRel()
- 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\Log::trace('Start', __METHOD__);
- 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 ($tools as $tool) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function addBlock(Block $blockInstance)
- 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
$fields = Field::getAllForModule($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- 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
public function deleteFromCRMEntity()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove row in vtiger_modentity_num table.
- 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 deleteFromModentityNum()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this;
- 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\Log::trace('Start', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove rows in vtiger_crmentity, vtiger_crmentityrel.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Access::updateTool($this, $tool, 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
* Get all the fields of the module or block.
- 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
{
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$db->createCommand()->delete('vtiger_relatedlists', ['or', ['tabid' => $this->id], ['related_tabid' => $this->id]])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel->delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($iconSize as $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|array $tools String or Array with value ['Import', 'Export']
- 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
$ids = array_keys($relations);
- 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 (!empty($this->tableName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param ModuleBasic $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Functions::recurseDelete("config/Modules/{$moduleInstance->name}.php");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Functions::recurseDelete("layouts/$name/modules/Settings/{$moduleInstance->name}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($layouts as $name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Access::allowSharing($this, false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Enable tools for this 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
foreach ($tools as $tool) {
- 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 disableTools($tools)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockInstance->save($this);
- 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
* Add filter to this module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fields;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($relations) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (array_unique($relations) as $tabId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove tables created by a module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->checkIntegrity(true)->execute();
- 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 (\App\Layout::getAllLayouts() as $name => $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
if ($db->isTableExists($tableName)) {
- 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
Functions::recurseDelete("layouts/$name/modules/{$moduleInstance->name}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Functions::recurseDelete("public_html/layouts/$name/modules/{$moduleInstance->name}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Functions::recurseDelete("public_html/layouts/$name/modules/Settings/{$moduleInstance->name}");
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function deleteIcons()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('End', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$iconSize = ['', 48, 64, 128];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($tablesName as $tableName) {
- 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
$db->createCommand()->checkIntegrity(false)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->dropTable($tableName)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tablesName = [$this->tableName . 'cf', $this->tableName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($tablesName as $tableName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->dropTable($tableName)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove files related to a 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function deleteModuleTables()
- 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
Functions::recurseDelete('modules/Settings/' . $moduleInstance->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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($db->isTableExists($tableName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove icons related to a module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$layouts = array_keys(\App\Layout::getAllLayouts());
- 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\Db::getInstance()->createCommand()->delete('vtiger_modentity_num', ['tabid' => $this->id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Start', __METHOD__);
- 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 deleteDir(self $moduleInstance)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Functions::recurseDelete('modules/' . $moduleInstance->name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleInstance = \Vtiger_Module_Model::getInstance($this->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
if (file_exists($fileName)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
@unlink($fileName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tablesName = [$this->tableName . '_inventory', $this->tableName . '_invfield', $this->tableName . '_invmap'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('End', __METHOD__);
- 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
Line exceeds 120 characters; contains 122 characters Open
$tablesName = [$this->tableName . '_inventory', $this->tableName . '_invfield', $this->tableName . '_invmap'];
- 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
$fileName = ROOT_DIRECTORY . "/public_html/layouts/$name/images/{$this->name}{$value}.png";
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('End', __METHOD__);
- 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
if ($moduleInstance->isInventory()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::trace('Start', __METHOD__);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
The variable $permission_text is not named in camelCase. Open
public function setDefaultSharing($permission_text = 'Public_ReadWriteDelete')
{
Access::setDefaultSharing($this, $permission_text);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The method __create is not named in camelCase. Open
public function __create()
{
\App\Log::trace("Creating Module $this->name ... STARTED", __METHOD__);
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __delete is not named in camelCase. Open
public function __delete()
{
Module::fireEvent($this->name, Module::EVENT_MODULE_PREUNINSTALL);
if ($this->isentitytype) {
$this->unsetEntityIdentifier();
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __update is not named in camelCase. Open
public function __update()
{
\App\Log::trace("Updating Module $this->name ... DONE", __METHOD__);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}
Source
The method __updateVersion is not named in camelCase. Open
public function __updateVersion($newVersion)
{
\App\Db::getInstance()->createCommand()->update('vtiger_tab', ['version' => $newVersion], ['tabid' => $this->id])->execute();
$this->version = $newVersion;
\App\Log::trace("Updating version to $newVersion ... DONE", __METHOD__);
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}