File Module.php
has 720 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.1
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
Method getTypeDetailsForAddField
has 214 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTypeDetailsForAddField($fieldType, $params)
{
$displayType = 1;
$importerType = new \App\Db\Importers\Base();
switch ($fieldType) {
Function getTypeDetailsForAddField
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
public function getTypeDetailsForAddField($fieldType, $params)
{
$displayType = 1;
$importerType = new \App\Db\Importers\Base();
switch ($fieldType) {
- 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 validate
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- 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
Settings_LayoutEditor_Module_Model
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'LayoutEditor';
/** @var string Parent name */
Method addField
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
The class Settings_LayoutEditor_Module_Model has an overall complexity of 163 which is very high. The configured complexity threshold is 50. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'LayoutEditor';
/** @var string Parent name */
- Exclude checks
Function addField
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
- 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 getMissingSystemFields
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getMissingSystemFields(): array
{
$fields = $this->getFields();
$systemFields = \App\Field::SYSTEM_FIELDS;
$missingFields = [];
- 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 getAddFieldTypeInfo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getAddFieldTypeInfo()
{
$fieldTypesInfo = [];
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
- 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 validate
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
Method getMissingSystemFields
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getMissingSystemFields(): array
{
$fields = $this->getFields();
$systemFields = \App\Field::SYSTEM_FIELDS;
$missingFields = [];
Method getAddFieldTypeInfo
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAddFieldTypeInfo()
{
$fieldTypesInfo = [];
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
Function getTableName
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getTableName($type)
{
if (\is_int($type)) {
$focus = CRMEntity::getInstance($this->getSourceModule()->getName());
if (0 == $type) {
- 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 addSystemField
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addSystemField(string $sysName, int $blockId, array $params = []): void
{
$missingSystemFields = $this->getMissingSystemFields();
if (empty($missingSystemFields[$sysName])) {
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- 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 isFieldsSortableAllowed
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isFieldsSortableAllowed($blockName)
{
$moduleName = $this->getSourceModule()->getName();
$blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
'Faq' => ['LBL_COMMENT_INFORMATION'],
- 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 getBlocks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getBlocks()
{
if (empty($this->blocks)) {
$blocksList = [];
$moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
The method getTypeDetailsForAddField() has 219 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function getTypeDetailsForAddField($fieldType, $params)
{
$displayType = 1;
$importerType = new \App\Db\Importers\Base();
switch ($fieldType) {
- Exclude checks
The method getAddFieldTypeInfo() has an NPath complexity of 201. The configured NPath complexity threshold is 200. Open
public function getAddFieldTypeInfo()
{
$fieldTypesInfo = [];
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method addField() has 105 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
- Exclude checks
The method addField() has an NPath complexity of 12960. The configured NPath complexity threshold is 200. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
- Read upRead up
- Exclude checks
NPathComplexity
Since: 0.1
The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.
Example
class Foo {
function bar() {
// lots of complicated code
}
}
Source https://phpmd.org/rules/codesize.html#npathcomplexity
The method validate() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10. Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method addField() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getTypeDetailsForAddField() has a Cyclomatic Complexity of 40. The configured cyclomatic complexity threshold is 10. Open
public function getTypeDetailsForAddField($fieldType, $params)
{
$displayType = 1;
$importerType = new \App\Db\Importers\Base();
switch ($fieldType) {
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
The method getAddFieldTypeInfo() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. Open
public function getAddFieldTypeInfo()
{
$fieldTypesInfo = [];
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
- Read upRead up
- Exclude checks
CyclomaticComplexity
Since: 0.1
Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.
Example
// Cyclomatic Complexity = 11
class Foo {
1 public function example() {
2 if ($a == $b) {
3 if ($a1 == $b1) {
fiddle();
4 } elseif ($a2 == $b2) {
fiddle();
} else {
fiddle();
}
5 } elseif ($c == $d) {
6 while ($c == $d) {
fiddle();
}
7 } elseif ($e == $f) {
8 for ($n = 0; $n < $h; $n++) {
fiddle();
}
} else {
switch ($z) {
9 case 1:
fiddle();
break;
10 case 2:
fiddle();
break;
11 case 3:
fiddle();
break;
default:
fiddle();
break;
}
}
}
}
Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
Reduce the number of switch cases from 38 to at most 30. Open
switch ($fieldType) {
- Read upRead up
- Exclude checks
When switch
statements have large sets of case
clauses, it is usually an attempt to map two sets of data. A real map
structure would be more readable and maintainable, and should be used instead.
Class "Settings_LayoutEditor_Module_Model" has 33 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
- 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.
Refactor this function to reduce its Cognitive Complexity from 19 to the 15 allowed. Open
public function getAddFieldTypeInfo()
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 34 to the 15 allowed. Open
public function validate(array $data, bool $throw = true)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed. Open
public function addField($fieldType, $blockId, $params)
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed. Open
public function getMissingSystemFields(): array
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.
See
This function "getTypeDetailsForAddField" has 218 lines, which is greater than the 150 lines authorized. Split it into smaller functions. Open
public function getTypeDetailsForAddField($fieldType, $params)
- Read upRead up
- Exclude checks
A function that grows too large tends to aggregate too many responsibilities.
Such functions inevitably become harder to understand and therefore harder to maintain.
Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.
Those smaller functions will not only be easier to understand, but also probably easier to test.
The class Settings_LayoutEditor_Module_Model has a coupling between objects value of 29. Consider to reduce the number of dependencies under 13. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'LayoutEditor';
/** @var string Parent name */
- 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 '259', column '16'). Open
throw new \App\Exceptions\AppException($message, $code);
- 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 '308', column '10'). Open
(new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();
- 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 '354', column '25'). Open
$fieldInstance = new vtlib\Field();
- 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 '851', column '35'). Open
) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());
- 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 '927', column '14'). Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- 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 '659', column '15'). Open
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->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 '850', column '13'). Open
&& !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->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 '912', column '14'). Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- 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 '671', column '15'). Open
return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])
- 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 '924', column '14'). Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);
- 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 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
The method validate has a boolean flag argument $throw, which is a certain sign of a Single Responsibility Principle violation. Open
public function validate(array $data, bool $throw = true)
- 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 '395', column '23'). Open
$importerType = 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
Missing class import via use statement (line '792', column '17'). Open
$query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);
- 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 '942', column '15'). Open
return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];
- 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 '708', column '15'). Open
return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->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 '921', column '14'). Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);
- 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 '332', column '21'). Open
$fieldModel = new Settings_LayoutEditor_Field_Model();
- 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 '956', column '34'). Open
$relatedReferenceFields = (new \App\Db\Query())
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid assigning values to variables in if clauses and the like (line '222', column '16'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_DUPLICATES_VALUES_FOUND', 'Other.Exceptions');
- 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 getTableName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$tableName = $focus->table_name . 'cf';
}
- 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 'Settings_WebserviceApps_Module_Model' in method 'getMissingSystemFields'. Open
foreach (Settings_WebserviceApps_Module_Model::getServers() as $id => $field) {
- 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_Field_Model' in method 'getMultiReferenceFieldsRelatedWithModule'. Open
$fieldModel = Vtiger_Field_Model::getInstanceFromFieldId($fieldId);
- 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 assigning values to variables in if clauses and the like (line '241', column '12'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '228', column '113'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');
- 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 'addField'. Open
$targetModule = vtlib\Module::getInstance($module);
- 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 isFieldsSortableAllowed uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
return false;
}
- 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_Relation_Model' in method 'getRelations'. Open
$this->relations = Vtiger_Relation_Model::getAllRelations($this->getSourceModule(), false, true, 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\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- 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 getTypeDetailsForAddField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$dbfldlength = $fieldLength + $decimal + 1;
}
- 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\Module' in method 'getTreeTemplates'. Open
$sourceModule = \App\Module::getModuleId($sourceModule);
- 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 addField uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$moduleList = $params['referenceModule'];
}
- 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\Relation' in method 'updateRelatedViewType'. Open
\App\Relation::clearCacheById($relationId);
- 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 assigning values to variables in if clauses and the like (line '244', column '17'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');
- 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 assigning values to variables in if clauses and the like (line '234', column '10'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
The method getMissingSystemFields uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$exist = true;
foreach ($validationConditions as $validationCondition) {
$status = true;
foreach ($fields as $fieldModel) {
- 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 'Settings_LayoutEditor_Block_Model' in method 'getBlocks'. Open
$moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
- 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\Json' in method 'addField'. Open
->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))
- 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\Purifier' in method 'validate'. Open
if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'addSystemField'. Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('LBL_WRONG_FIELD_TYPE', 'Settings::LayoutEditor');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'addSystemField'. Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);
- 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 'getFieldsForWebserviceApps'. Open
return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];
- 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 assigning values to variables in if clauses and the like (line '216', column '10'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class 'CRMEntity' in method 'getTableName'. Open
$focus = CRMEntity::getInstance($this->getSourceModule()->getName());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Language' in method 'addSystemField'. Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);
- 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_Block_Model' in method 'addSystemField'. Open
$blockModel = Vtiger_Block_Model::getInstance($blockId, $this->getSourceModule()->getName());
- 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 'setSourceModule'. Open
$this->sourceModule = \Vtiger_Module_Model::getInstance($sourceModule);
- 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_Block_Model' in method 'addField'. Open
$blockModel = Vtiger_Block_Model::getInstance($blockId, $moduleName);
- 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_LayoutEditor_Field_Model' in method 'getFields'. Open
$fieldList = Settings_LayoutEditor_Field_Model::getInstanceFromBlockIdList($blockId);
- 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 assigning values to variables in if clauses and the like (line '241', column '62'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid assigning values to variables in if clauses and the like (line '219', column '16'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'validate'. Open
$message = \App\Language::translate('ERR_EXCEEDED_NUMBER_CHARACTERS', 'Other.Exceptions');
- 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 'addField'. 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
The method getTableName uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$tableName = $type;
}
- 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\Language' in method 'getMissingSystemFields'. Open
'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',
- 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 assigning values to variables in if clauses and the like (line '209', column '10'). Open
public function validate(array $data, bool $throw = true)
{
$message = null;
$code = null;
$result = false;
- Read upRead up
- Exclude checks
IfStatementAssignment
Since: 2.7.0
Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.
Example
class Foo
{
public function bar($flag)
{
if ($foo = 'bar') { // possible typo
// ...
}
if ($baz = 0) { // always false
// ...
}
}
}
Source http://phpmd.org/rules/cleancode.html#ifstatementassignment
Avoid using static access to class '\App\Language' in method 'addSystemField'. Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- 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\Picklist' in method 'checkIfPicklistFieldNameReserved'. Open
\App\Fields\Picklist::isPicklistExist($fieldName)
- 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 'checkIfPicklistFieldNameReserved'. Open
) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());
- 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_Field_Model' in method 'getMissingSystemFields'. Open
$missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['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
Define a constant instead of duplicating this literal "MultipicklistTags" 4 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "Currency" 5 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "uitype" 5 times. Open
->set('uitype', $details['uitype'])
- 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 "Related1M" 4 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "MultiReferenceValue" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "header_field" 3 times. Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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 "referenceModule" 4 times. Open
'module' => $params['referenceModule']
- 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 "generatedtype" 3 times. Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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 "fieldname" 3 times. Open
->andWhere(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->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_field" 5 times. Open
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->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 "typeofdata" 3 times. Open
->set('typeofdata', $details['typeofdata'])
- 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 "MultiReference" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "MapCoordinates" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "Settings::LayoutEditor" 11 times. Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "module" 4 times. Open
'module' => $params['MRVModule'],
- 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.
Rename "$name" which has the same name as the field declared at line 15. Open
$name = 'share_externally_' . $id;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Define a constant instead of duplicating this literal "fieldparams" 4 times. Open
->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))
- 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 "summaryfield" 3 times. Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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 "Token" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "displayType" 5 times. Open
if (isset($details['displayType']) || isset($params['displayType'])) {
- 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" 4 times. Open
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->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 "Integer" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "Other.Exceptions" 3 times. Open
$message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');
- 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 "pickListValues" 6 times. Open
case 'pickListValues':
- 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 "fieldType" 3 times. Open
} elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {
- 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 "quickcreate" 3 times. Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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 "Decimal" 4 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "CategoryMultipicklist" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "AdvPercentage" 4 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "Picklist" 6 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "MultiSelectCombo" 5 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "LBL_DUPLICATE_FIELD_EXISTS" 5 times. Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- 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 "label" 5 times. Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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 "ServerAccess" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "Group" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "Phone" 3 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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 "fieldLength" 6 times. Open
$fieldModel->set('maximumlength', $params['fieldLength'] ?? null);
- 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 "Editor" 5 times. Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- 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.
Rename "$name" which has the same name as the field declared at line 15. Open
$name = strtolower($params['fieldName']);
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Avoid unused parameters such as '$blockInstance'. Open
public function getFields($blockInstance = false)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
Assigning false
to property but \Settings_LayoutEditor_Module_Model::$supportedModules
is string[]
Open
public static $supportedModules = false;
- Exclude checks
Reference to undeclared property \CRMEntity->table_name
Open
$tableName = $focus->table_name . 'cf';
- Exclude checks
Return type of getTypeDetailsForAddField()
is undeclared type \sting[]
(Did you mean string) Open
public function getTypeDetailsForAddField($fieldType, $params)
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType(30)->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->boolean()->defaultValue(false);
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks
(Did you mean $block) Open
return $this->blocks;
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType($fieldLength)->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType($fieldLength)->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType(Vtiger_Token_UIType::MAX_LENGTH)->defaultValue('');
- Exclude checks
Reference to undeclared property \CRMEntity->customFieldTable
Open
$tableName = $focus->customFieldTable[0];
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks
Open
if (empty($this->blocks)) {
- Exclude checks
Argument 2 (code)
is ?512|?513
but \App\Exceptions\AppException::__construct()
takes int
Open
throw new \App\Exceptions\AppException($message, $code);
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->boolean()->defaultValue(false);
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType(30)->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->integer($fieldLength)->defaultValue(0);
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->integer()->defaultValue(null)->unsigned();
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
Open
return $this->fields;
- Exclude checks
Argument 1 (module)
is false
but \CRMEntity::getInstance()
takes string
defined at /code/include/CRMEntity.php:61
Open
$focus = CRMEntity::getInstance($this->getSourceModule()->getName());
- Exclude checks
Reference to undeclared property \CRMEntity->customFieldTable
Open
if (isset($focus->customFieldTable)) {
- Exclude checks
Assigning string
to property but \vtlib\Field->column
is false
Open
$fieldInstance->column = $name . '_extra';
- Exclude checks
Variable $uitype
is undeclared Open
$uitype = $uitype ?? 7;
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType(100)->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->integer(10)->defaultValue(0)->unsigned();
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->blocks
(Did you mean $block) Open
$this->blocks = $blocksList;
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
Open
if (empty($this->fields)) {
- Exclude checks
Reference to undeclared property \Settings_LayoutEditor_Module_Model->fields
Open
$this->fields = $fieldList;
- Exclude checks
Assigning string
to property but \vtlib\Field->table
is false
Open
$fieldInstance->table = $tableName;
- Exclude checks
Argument 1 (module)
is false
but \Vtiger_Field_Model::init()
takes string
defined at /code/modules/Vtiger/models/Field.php:93
Open
$missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();
- Exclude checks
Returning type array{uitype:1|5|7|9|10|11|13|14|15|16|17|18|21|33|35|56|69|71|79|85|300|302|305|308|309|311|313|314|316|318|319|321|324|330|331|333|365|null,typeofdata:'C\x7eO'|'DT\x7eO'|'D\x7eO'|'E\x7eO'|'I\x7eO'|'NN\x7eO'|'N\x7eO'|'N\x7eO\x7e2\x7e2'|'T\x7eO'|'V\x7eO'|'V\x7eO\x7eLE\x7e15'|null|string,dbType:\yii\db\ColumnSchemaBuilder|null,displayType:1|3|5}
but getTypeDetailsForAddField()
is declared to return \sting[]|int[]
Open
'uitype' => $uitype,
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])
- Exclude checks
Argument 1 (message)
is ?string
but \App\Exceptions\AppException::__construct()
takes string
Open
throw new \App\Exceptions\AppException($message, $code);
- Exclude checks
Call to method defaultValue
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Reference to undeclared property \CRMEntity->table_name
Open
$tableName = $focus->table_name;
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$relatedReferenceFields = (new \App\Db\Query())
- Exclude checks
Call to method null
from undeclared class \yii\db\ColumnSchemaBuilder
(Did you mean class \App\Db\Drivers\Mysql\ColumnSchemaBuilder or class \App\Db\Drivers\Pgsql\ColumnSchemaBuilder) Open
$type = $importerType->integer()->null();
- Exclude checks
Returning type ?string
but getTableName()
is declared to return string
Open
return $tableName;
- Exclude checks
Variable $moduleList
was undeclared, but array fields are being added to it. Open
$moduleList[] = $params['referenceModule'];
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();
- Exclude checks
Saw an @param annotation for sourceModule,
but it was not found in the param list of function getMultiReferenceFieldsRelatedWithModule(string $moduleName) : \Vtiger_Field_Model[]|array
Open
* @param string $sourceModule Source module name
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
\App\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
$query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
&& !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()
- Exclude checks
This branch's code block is the same as the block for the branch on line 222. Open
} elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {
$message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
$code = 512;
}
- Read upRead up
- Exclude checks
Having two cases
in a switch
statement or two branches in an if
chain with the same implementation is at
best duplicate code, and at worst a coding error. If the same logic is truly needed for both instances, then in an if
chain they should
be combined, or for a switch
, one should fall through to the other.
Noncompliant Code Example
switch ($i) { case 1: doSomething(); break; case 2: doSomethingDifferent(); break; case 3: // Noncompliant; duplicates case 1's implementation doSomething(); break; default: doTheRest(); } if ($a >= 0 && $a < 10) { doTheThing(); else if ($a >= 10 && $a < 20) { doTheOtherThing(); } else if ($a >= 20 && $a < 50) { doTheThing(); // Noncompliant; duplicates first condition } else { doTheRest(); } if ($b == 0) { doOneMoreThing(); } else { doOneMoreThing(); // Noncompliant; duplicates then-branch } var b = a ? 12 > 4 : 4; // Noncompliant; always results in the same value
Compliant Solution
switch ($i) { case 1: case 3: doSomething(); break; case 2: doSomethingDifferent(); break; default: doTheRest(); } if (($a >= 0 && $a < 10) || ($a >= 20 && $a < 50)) { doTheThing(); else if ($a >= 10 && $a < 20) { doTheOtherThing(); } else { doTheRest(); } doOneMoreThing(); b = 4;
or
switch ($i) { case 1: doSomething(); break; case 2: doSomethingDifferent(); break; case 3: doThirdThing(); break; default: doTheRest(); } if ($a >= 0 && $a < 10) { doTheThing(); else if ($a >= 10 && $a < 20) { doTheOtherThing(); } else if ($a >= 20 && $a < 50) { doTheThirdThing(); } else { doTheRest(); } if ($b == 0) { doOneMoreThing(); } else { doTheRest(); } int b = a ? 12 > 4 : 8;
Exceptions
Blocks in an if
chain that contain a single line of code are ignored, as are blocks in a switch
statement that contain a
single line of code with or without a following break
.
Avoid excessively long variable names like $lengthSupportedFieldTypes. Keep variable name length under 20. Open
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $addFieldSupportedTypes. Keep variable name length under 20. Open
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $blocksEliminatedArray. Keep variable name length under 20. Open
$blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Avoid excessively long variable names like $relatedReferenceFields. Keep variable name length under 20. Open
$relatedReferenceFields = (new \App\Db\Query())
- Read upRead up
- Exclude checks
LongVariable
Since: 0.2
Detects when a field, formal or local variable is declared with a long name.
Example
class Something {
protected $reallyLongIntName = -3; // VIOLATION - Field
public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
$otherReallyLongName = -5; // VIOLATION - Local
for ($interestingIntIndex = 0; // VIOLATION - For
$interestingIntIndex < 10;
$interestingIntIndex++ ) {
}
}
}
Source https://phpmd.org/rules/naming.html#longvariable
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks
The class Settings_LayoutEditor_Module_Model is not named in CamelCase. Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
{
/** {@inheritdoc} */
public $name = 'LayoutEditor';
/** @var string Parent name */
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string Parent name */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SummaryTop' => 'LBL_SUMMARY_TOP_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] List of supported relation types */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'getRelatedList' => 'PLL_RELATED_LIST',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// 'getActivities' => 'PLL_ACTIVITIES',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//'getDependentsList' => 'PLL_DEPENDENTS_LIST',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] List of supported modules */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] List of fields in edit view modal */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $name = 'LayoutEditor';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const TYPES = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public const RELATED_VIEW_TYPE = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'getAttachments' => 'PLL_ATTACHMENTS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'RelatedTab' => 'LBL_RELATED_TAB_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static $supportedModules = 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'getMultiReference' => 'PLL_MULTI_REFERENCE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DetailBottom' => 'LBL_DETAIL_BOTTOM_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'SummaryBottom' => 'LBL_SUMMARY_BOTTOM_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $parent = 'Settings';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $isentitytype = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'DetailTop' => 'LBL_DETAIL_TOP_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'getManyToMany' => 'PLL_SPLITED_RELATED_LIST',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'getEmails' => 'PLL_EMAILS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var string[] Related view types. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Currency' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['ModuleListMultiple'] = 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
* @return int
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Gets parent 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
return $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blocksList[$block->get('label')] = $block;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getAddFieldTypeInfo()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$addFieldSupportedTypes = $this->getAddSupportedFieldTypes();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getSourceModule(): Vtiger_Module_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//including mantisaa and integer part
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Verification of data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function that returns all the fields for the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $blockInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->fields)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockId = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getAddSupportedFieldTypes()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$lengthSupportedFieldTypes = ['Text', 'Decimal', 'Integer', 'Currency', 'Editor', 'AdvPercentage'];
- Exclude checks
Spaces must 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 $sourceModule;
- Exclude checks
Spaces must 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 which will give information about the field types that are supported for add.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($fieldType, $lengthSupportedFieldTypes)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['lengthsupported'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['preDefinedValueType'] = 'text';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get source module model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->sourceModule;
- Exclude checks
Spaces must 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
* List of supported field types.
- Exclude checks
Spaces must 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 (\count($blockId) > 0) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function returns all the blocks for the module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Block_Model[] - list of block models
- Exclude checks
Spaces must 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 ($block->get('label')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->blocks;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Picklist' === $fieldType || 'MultiSelectCombo' === $fieldType || 'MultipicklistTags' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Related1M' === $fieldType) {
- Exclude checks
Spaces must 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
$fieldList = Settings_LayoutEditor_Field_Model::getInstanceFromBlockIdList($blockId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blocksList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleBlocks = Settings_LayoutEditor_Block_Model::getAllForModule($this->sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->blocks = $blocksList;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Decimal' === $fieldType || 'Currency' === $fieldType || 'AdvPercentage' === $fieldType) {
- Exclude checks
Spaces must 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 bool $throw
- 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
}
- Exclude checks
Spaces must 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
$blockId[] = $block->get('id');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->blocks)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Picklist' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldTypesInfo[$fieldType] = $details;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fieldTypesInfo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $data
- Exclude checks
Spaces must 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 Vtiger_Module_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($blocks as $block) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($moduleBlocks as $block) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Editor' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['maxLength'] = 64;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['preDefinedValueExists'] = true;
- 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
$this->sourceModule = \Vtiger_Module_Model::getInstance($sourceModule);
- Exclude checks
Spaces must 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
$details['decimalReadonly'] = 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
* @param string $sourceModule
- Exclude checks
Spaces must 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 Vtiger_Field_Model[] - list of field models
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['noLimitForLength'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const EDIT_FIELDS_FORM = [
- Exclude checks
Spaces must 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
$fieldList = [];
- Exclude checks
Spaces must 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
$details['picklistoption'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label', 'presence', 'quickcreate', 'summaryfield', 'generatedtype', 'masseditable', 'header_field',
- 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
public function setSourceModule(string $sourceModule)
- Exclude checks
Spaces must 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->fields;
- Exclude checks
Spaces must 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
foreach ($addFieldSupportedTypes as $fieldType) {
- Exclude checks
Spaces must 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->getSourceModule()->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
public function getParentName()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->parent;
- Exclude checks
Spaces must 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 getBlocks()
- Exclude checks
Line exceeds 120 characters; contains 486 characters Open
'Text', 'Decimal', 'Integer', 'Currency', 'Percent', 'AdvPercentage', 'Date', 'Time', 'DateTime', 'RangeTime', 'Phone', 'Email', 'MultiEmail', 'MultiDomain', 'Picklist', 'MultiSelectCombo', 'MultipicklistTags', 'Country', 'URL', 'Checkbox', 'TextArea', 'Related1M', 'MultiReference', 'Editor', 'Tree', 'CategoryMultipicklist', 'Image', 'MultiImage', 'MultiAttachment', 'MultiReferenceValue', 'ServerAccess', 'Skype', 'Twitter', 'Token', 'Smtp', 'MapCoordinates', 'Group',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldTypesInfo = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details['decimalSupported'] = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//text area value type , can give multiple values
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $relations;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var Vtiger_Module_Model Source 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
$details['maxFloatingDigits'] = 5;
- Exclude checks
Spaces must 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 validate(array $data, bool $throw = true)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'displaytype', 'maxlengthtext', 'maxwidthcolumn', 'tabindex', 'mandatory', 'icon',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Relations */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set source 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
$blocks = $this->getBlocks();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fields = $fieldList;
- Exclude checks
Spaces must 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 string[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [
- Exclude checks
Spaces must 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
} elseif ($result = $this->checkFieldNameIsAnException($value)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'pickListValues':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($value as $val) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
\App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('uitype', $details['uitype'])
- Exclude checks
Line exceeds 120 characters; contains 188 characters Open
} elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (isset($data['fieldType']) && \in_array($data['fieldType'], ['Picklist', 'MultiSelectCombo']) && ($result = $this->checkIfPicklistFieldNameReserved($value))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('ERR_EXCEEDED_NUMBER_CHARACTERS', 'Other.Exceptions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_WRONG_FIELD_TYPE', 'Settings::LayoutEditor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$label = $params['fieldLabel'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Token':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showType' => $params['isCoordinateType'] ?? 0,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [$key => $message];
- Exclude checks
Spaces must 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 ($result) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $blockId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Tree':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('label', $label)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('typeofdata', $details['typeofdata'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'fieldType':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($result = \strlen($val) > 200) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldType
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListValues = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'CategoryMultipicklist':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'ServerAccess':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('header_field', $params['header_field'] ?? null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (\strlen($value) > 30) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 513;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = (int) $params['tree'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_DUPLICATES_VALUES_FOUND', 'Other.Exceptions');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $this->getSourceModule()->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module' => $params['referenceModule']
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'fieldName':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$name = strtolower($params['fieldName']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiReferenceValue':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('fieldparams', $params['fieldparams'] ?? ($fieldParams ? \App\Json::encode($fieldParams) : ''))
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Editor' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->set('name', $name)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$value = strtolower($value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_FIELD_NAME_IS_RESERVED', 'Settings::LayoutEditor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @throws Exception
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 513;
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$pickListValues = $params['pickListValues'] = \is_string($params['pickListValues']) ? [$params['pickListValues']] : $params['pickListValues'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = '';
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
(new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'type' => $params['type'] ?? null,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiReference':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showAllGroups' => $params['showAllGroups'] ?? 0
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showLocation' => $params['isCoordinateMeLokaction'] ?? 0,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Add field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $this->getTableName($params['fieldTypeList']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'filterValue' => $params['MRVFilterValue'] ?? null,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
(new \App\BatchMethod(['method' => '\App\Fields\Token::setTokens', 'params' => [$name, $moduleName]]))->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('helpinfo', $params['helpinfo'] ?? '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$result = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result = $this->checkFieldLabelExists($value)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor');
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
$message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');
- Exclude checks
Line exceeds 120 characters; contains 135 characters Open
$message = \App\Language::translateArgs('ERR_SPECIAL_CHARACTERS_NOT_ALLOWED', 'Other.Exceptions', '<>"#,');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($throw) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'filterField' => $params['MRVFilterField'] ?? null,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('quickcreate', $params['quickcreate'] ?? 1)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('summaryfield', $params['summaryfield'] ?? 0)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result = $this->checkFieldNameCharacters($value)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($key) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'fieldLabel':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $params
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException($message, $code);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\array_key_exists('pickListValues', $params)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $result;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Db::getInstance()->createCommand()->insert('s_#__multireference', ['source_module' => $moduleName, 'dest_module' => $params['MRVModule']])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'field' => $params['MRVField'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldParams = (int) $params['server'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($result = $this->checkFieldNameExists($value)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$code = 512;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('generatedtype', $params['generatedtype'] ?? 2)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$message = \App\Language::translate('LBL_EXCEEDED_MAXIMUM_NUMBER_CHARACTERS_FOR_FIELD_NAME', 'Settings::LayoutEditor');
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
if (($result = preg_match('/[\<\>\"\#\,]/', $val)) || ($result = preg_match('/[\<\>\"\#\,]/', \App\Purifier::decodeHtml($val)))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\count($value) !== \count(array_unique(array_map('strtolower', $value)))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = new Settings_LayoutEditor_Field_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Settings_LayoutEditor_Field_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('columntype', $details['dbType']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pickListValues = $params['pickListValues'] = \is_string($params['pickListValues']) ? [$params['pickListValues']] : $params['pickListValues'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module' => $params['MRVModule'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'showMap' => $params['isCoordinateMap'] ?? 0,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($data as $key => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($result = !\in_array($value, $this->getAddSupportedFieldTypes())) {
- Exclude checks
Spaces must 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 addField($fieldType, $blockId, $params)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->validate($params);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MapCoordinates':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Group':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$details = $this->getTypeDetailsForAddField($fieldType, $params);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->set('table', $tableName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->column = $name . '_extra';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Picklist' === $fieldType || 'MultiSelectCombo' === $fieldType || 'MultipicklistTags' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Decimal':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($params['isRoleBasedPickList'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 17;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Phone' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetModule->setRelatedList($this->getSourceModule(), $moduleName, ['Add'], 'getDependentsList', $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
$uitype = 365;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 9;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (1 == $fieldLength) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbfldlength = $fieldLength + $decimal + 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(100)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->boolean()->defaultValue(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 7;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance = new vtlib\Field();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->label = 'FL_PHONE_CUSTOM_INFORMATION';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$importerType = new \App\Db\Importers\Base();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModel = Vtiger_Block_Model::getInstance($blockId, $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->maxlengthtext = 100;
- 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
$uitype = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// no break
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = $params['fieldLength'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->set('maximumlength', $params['fieldLength'] ?? null);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->name = $name . '_extra';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList = $params['referenceModule'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($moduleList as $module) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$targetModule = vtlib\Module::getInstance($module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = $uitype ?? 7;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Date':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 15;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 18;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'TextArea':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 21;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->integer($fieldLength)->defaultValue(0);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($details['displayType']) || isset($params['displayType'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType($fieldLength)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 16;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'URL':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->table = $tableName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function defines details of the created field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'D~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'C~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 33;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'I~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->save($blockModel);
- 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O~LE~' . $fieldLength;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decimal = $params['decimal'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbfldlength = $fieldLength + $decimal + 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->decimal($dbfldlength, $decimal);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->date();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Time':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 14;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Skype':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 85;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->set('displaytype', $params['displayType'] ?? $details['displayType']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->displaytype = 3;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldType
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getTypeDetailsForAddField($fieldType, $params)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = $params['fieldLength'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return (sting|int)[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Percent':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decimal = $params['decimal'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 71;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$decimal = $decimal + 3;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'N~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Phone':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 11;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultipicklistTags':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 56;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiSelectCombo':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModel->addField($fieldModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\is_array($params['referenceModule'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
$targetModule->setRelatedList($this->getSourceModule(), $moduleName, ['Add'], 'getDependentsList', $name);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array $params
- 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
$uitype = 5;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 13;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->time();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType()->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Checkbox':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->setRelatedModules($moduleList);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = $params['fieldLength'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->decimal($dbfldlength, $decimal);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
// Fix for http://trac.vtiger.com/cgi-bin/trac.cgi/ticket/6363
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'T~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(30)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->uitype = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->setPicklistValues($pickListValues);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Related1M' === $fieldType) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'NN~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dbfldlength = $fieldLength + $decimal + 2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Email':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Picklist':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'N~O~2~2';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Currency':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Integer':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = $params['fieldLength'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->typeofdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleList[] = $params['referenceModule'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$displayType = 1;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Text':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'AdvPercentage':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->decimal(5, 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'E~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 69;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 309;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 330;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $focus->table_name . 'cf';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Image':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 316;
- 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
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text($fieldLength);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 79;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Country':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->boolean()->defaultValue(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->integer(10);
- Exclude checks
Spaces must 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
$type = $importerType->integer(10)->defaultValue(0)->unsigned();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiImage':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Smtp':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 10;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = $params['fieldLength'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'I~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->integer()->null();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiReferenceValue':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Token':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 35;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => $uichekdata,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldLength = Vtiger_Twitter_UIType::MAX_LENGTH;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(30)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
default:
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->dateTime();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 313;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType($fieldLength)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 == $type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'C~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $focus->table_name;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiAttachment':
- Exclude checks
Spaces must 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 getTableName($type)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($focus->customFieldTable)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 300;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Group':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (1 == $type) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Editor':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 302;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'CategoryMultipicklist':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'ServerAccess':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 333;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'I~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'uitype' => $uitype,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get table name.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $tableName;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 305;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 314;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'RangeTime':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(Vtiger_Token_UIType::MAX_LENGTH)->defaultValue('');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O~LE~' . $fieldLength;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 324;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MapCoordinates':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 331;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'displayType' => $displayType,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Twitter':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must 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 $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 311;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'DateTime':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(255);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 319;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->text();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$displayType = 3;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $type;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'DT~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 308;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 321;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'dbType' => $type,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tableName = $focus->customFieldTable[0];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkFieldNameCharacters($name): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Tree':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uitype = 318;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->stringType(100);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\is_int($type)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$type = $importerType->integer()->defaultValue(null)->unsigned();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiReference':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$uichekdata = 'V~O';
- Exclude checks
Spaces must 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 preg_match('#[^a-z0-9_]#is', $name) || !preg_match('/[a-z]/i', $name) || false !== strpos($name, ' ');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'Related1M':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$displayType = 5;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiEmail':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'MultiDomain':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$focus = CRMEntity::getInstance($this->getSourceModule()->getName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check field name characters.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkFieldLabelExists(string $fieldLabel): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'id', 'seq', 'header_type', 'header_class',
- Exclude checks
Spaces must 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 returns available templates for tree type field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $sourceModule
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);
- 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
* Check if field exists.
- Exclude checks
Spaces must 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 isBlockSortableAllowed(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$dataReader->close();
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();
- Exclude checks
Spaces must 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 string[] List of Entity modules
- Exclude checks
Line exceeds 120 characters; contains 233 characters Open
return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->createCommand()->queryAllByGroup();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
'Calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \in_array($fieldName, [
- Exclude checks
Spaces must 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
Line exceeds 120 characters; contains 185 characters Open
$query = (new \App\Db\Query())->select(['templateid', 'name'])->from('vtiger_trees_templates')->where(['tabid' => $sourceModule])->orWhere(['like', 'share', ",$sourceModule,"]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function checkFieldNameExists(string $fieldName): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must 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 isTypeChangeAllowed()
- Exclude checks
Spaces must 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 (null === $this->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
*
- Exclude checks
Spaces must 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 array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldLabel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Calendar' => ['LBL_TASK_INFORMATION', 'LBL_DESCRIPTION_INFORMATION', 'LBL_REMINDER_INFORMATION', 'LBL_RECURRENCE_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
* Get 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
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check field is editable or not.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 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
return $this->getSourceModule()->isTypeChangeAllowed();
- Exclude checks
Spaces must 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 getTreeTemplates($sourceModule)
- Exclude checks
Spaces must 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 isSortableAllowed()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check fields are sortable for the block.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getEntityInstance()
- Exclude checks
Spaces must 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
* Check if label exists.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $blockName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($blocksEliminatedArray[$moduleName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getRelations()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$treeList[$row['templateid']] = $row['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
public function checkFieldNameIsAnException(string $fieldName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'module', 'parent', 'action', 'mode', 'view', 'selected_ids',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_module', 'viewname', 'sortorder', 'orderby', 'inventory', 'private', 'src_record', 'relationid', 'relation_id', 'picklist', 'overwritten_shownerid', 'relationoperation', 'sourcemodule', 'sourcerecord'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getEntityModulesList()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->relations = Vtiger_Relation_Model::getAllRelations($this->getSourceModule(), false, true, 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
return self::$supportedModules;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get Entity module names list.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check blocks are sortable 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
public function isFieldsSortableAllowed($blockName)
- Exclude checks
Spaces must 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 bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($blockName, $blocksEliminatedArray[$moduleName])) {
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must 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
* Check if the field name is reserved.
- Exclude checks
Spaces must 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
$moduleName = $this->getSourceModule()->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\in_array($moduleName, ['HelpDesk', 'Faq'])) {
- Exclude checks
Spaces must 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 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
return $this->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
return (new \App\Db\Query())->from('vtiger_field')->where(['fieldlabel' => $fieldLabel, 'tabid' => $this->getId()])->exists();
- Exclude checks
Spaces must 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
'excluded_ids', 'search_params', 'search_key', 'page', 'operator',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getSupportedModules()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty(self::$supportedModules)) {
- Exclude checks
Spaces must 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 'ModComments' !== $this->getSourceModule()->getName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blocksEliminatedArray = ['HelpDesk' => ['LBL_TICKET_RESOLUTION', 'LBL_COMMENTS'],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->getSourceModule()->getEntityInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$sourceModule = \App\Module::getModuleId($sourceModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $treeList;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$restrictedModules = ['Integration', 'Dashboard'];
- Exclude checks
Spaces must 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
$treeList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
while ($row = $dataReader->read()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string|null $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $this->getId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 220 characters Open
'source_module', 'viewname', 'sortorder', 'orderby', 'inventory', 'private', 'src_record', 'relationid', 'relation_id', 'picklist', 'overwritten_shownerid', 'relationoperation', 'sourcemodule', 'sourcerecord'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
self::$supportedModules = self::getEntityModulesList();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return (new \App\Db\Query())->select(['name', 'module' => 'name'])->from('vtiger_tab')->where(['presence' => [0, 2], 'isentitytype' => 1])->andWhere(['not in', 'name', $restrictedModules])->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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'Faq' => ['LBL_COMMENT_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
* Get relations types.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'ADD' => 'PLL_ADD',
- Exclude checks
Spaces must 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 checkIfPicklistFieldNameReserved(string $fieldName): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($systemFields as $name => $field) {
- Exclude checks
Line exceeds 120 characters; contains 127 characters Open
$missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModel = Vtiger_Block_Model::getInstance($blockId, $this->getSourceModule()->getName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$relatedReferenceFields = (new \App\Db\Query())
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->from('vtiger_field')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Update related view type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $fieldName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$missingFields[$name] = \Vtiger_Field_Model::init($this->getSourceModule()->getName(), $field, $field['name']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must 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 $referenceFieldModels;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string[] $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get missing system fields.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($systemFields['share_externally']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($params) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldsForWebserviceApps(int $webserviceApp): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$referenceFieldModels = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['uitype' => 321],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Relation::clearCacheById($relationId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Loading the list of multireference fields related with module.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($relatedReferenceFields as $fieldId) {
- Exclude checks
Spaces must 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 int $relationId
- Exclude checks
Spaces must 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()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->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
$systemFields = \App\Field::SYSTEM_FIELDS;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$validationConditions = $field['validationConditions'];
- 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
continue 2;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = true;
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must 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->checkFieldNameExists($fieldModel->get('name'))) {
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$referenceFieldModels[] = $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $sysName
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_INVALIDCHARACTER', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must 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 ('OSSMailView' === $moduleName) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getRelationsActions()
- Exclude checks
Line exceeds 120 characters; contains 160 characters Open
\App\Db::getInstance()->createCommand()->update('vtiger_relatedlists', ['view_type' => implode(',', $type)], ['relation_id' => $relationId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$name = 'share_externally_' . $id;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- Exclude checks
Line exceeds 120 characters; contains 125 characters Open
'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldparams' => $id,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$exist = !$status;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($field['validationConditions']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $missingFields;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Create system field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getRelationsTypes(?string $moduleName = null): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $types;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 199 characters Open
) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$systemFields[$name] = array_merge($systemFields['share_externally'], [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($validationConditions === ['name']) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 138 characters Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);
- Exclude checks
Line exceeds 120 characters; contains 171 characters Open
return (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$types['getRecordToMails'] = 'PLL_RECORD_TO_MAILS';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$exist = isset($fields[$name]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$exist = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldModel->get($validationCondition) == $field[$validationCondition]) {
- Exclude checks
Spaces must 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 addSystemField(string $sysName, int $blockId, array $params = []): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->checkFieldLabelExists($fieldModel->get('name'))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockModel->addField($fieldModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get fields for webservice apps.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $webserviceApp
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must 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 [
- Exclude checks
Spaces must 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 array $params
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($params as $key => $value) {
- Exclude checks
Spaces must 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 (new \App\Db\Query())->from('w_#__fields_server')->where(['serverid' => $webserviceApp])->indexBy('fieldid')->all(\App\Db::getInstance('webservice')) ?: [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$types = self::TYPES;
- Exclude checks
Spaces must 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 \Vtiger_Field_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (Settings_WebserviceApps_Module_Model::getServers() as $id => $field) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $missingSystemFields[$sysName];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->set($key, $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $sourceModule Source module name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Field_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getMultiReferenceFieldsRelatedWithModule(string $moduleName): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
&& !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$exist) {
- Exclude checks
Spaces must 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
$missingSystemFields = $this->getMissingSystemFields();
- Exclude checks
Spaces must 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->checkFieldNameCharacters($fieldModel->get('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
'SELECT' => 'PLL_SELECT',
- Exclude checks
Spaces must 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
foreach ($validationConditions as $validationCondition) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 513);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $moduleName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function updateRelatedViewType($relationId, $type)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
) || \in_array($fieldName, (new \App\Db\Query())->select(['fieldname'])->from('vtiger_field')->where(['tabid' => \App\Module::getModuleId('Users'), 'uitype' => [16, 15, 33, 115]])->column());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getMissingSystemFields(): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = $this->getFields();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$missingFields = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => $field['name'] . ' (' . \App\Language::translate($field['type'], 'Settings:WebserviceApps') . ')',
- Exclude checks
Spaces must 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 int $blockId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($missingSystemFields[$sysName])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->select(['fieldid'])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldModel->isActiveField()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Check if picklist field can have that name.
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
&& !(new \App\Db\Query())->from('vtiger_field')->where(['or', ['fieldname' => $fieldName], ['columnname' => $fieldName]])->exists()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'name' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
throw new \App\Exceptions\AppException(\App\Language::translate('LBL_DUPLICATE_FIELD_EXISTS', 'Settings::LayoutEditor'), 512);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
['like', 'fieldparams', '{"module":"' . $moduleName . '"%', false]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->column();
- Exclude checks
Spaces must 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 (
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Fields\Picklist::isPicklistExist($fieldName)
- Exclude checks
Spaces must 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 ($fields as $fieldModel) {
- Exclude checks
Spaces must 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
->where(['and',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = Vtiger_Field_Model::getInstanceFromFieldId($fieldId);
- Exclude checks
Class name "Settings_LayoutEditor_Module_Model" is not in camel caps format Open
class Settings_LayoutEditor_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks