File Field.php
has 444 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 getFieldItemByName
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
The class Settings_LayoutEditor_Field_Model has an overall complexity of 82 which is very high. The configured complexity threshold is 50. Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
{
/** @var Settings_Vtiger_Field_Model[] Item field models */
private $items = [];
/** @var Vtiger_Field_Model|null Source field model */
- Exclude checks
Method delete
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete()
{
$db = \App\Db::getInstance();
try {
parent::delete();
Function getFieldItemByName
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
- 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_Field_Model
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
{
/** @var Settings_Vtiger_Field_Model[] Item field models */
private $items = [];
/** @var Vtiger_Field_Model|null Source field model */
Function delete
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function delete()
{
$db = \App\Db::getInstance();
try {
parent::delete();
- 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 getFieldItemByName() has 148 lines of code. Current threshold is set to 100. Avoid really long methods. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
- Exclude checks
The method delete() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. Open
public function delete()
{
$db = \App\Db::getInstance();
try {
parent::delete();
- 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 getFieldItemByName() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
- 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
Class "Settings_LayoutEditor_Field_Model" has 22 methods, which is greater than 20 authorized. Split it into smaller classes. Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_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.
The class Settings_LayoutEditor_Field_Model has a coupling between objects value of 16. Consider to reduce the number of dependencies under 13. Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
{
/** @var Settings_Vtiger_Field_Model[] Item field models */
private $items = [];
/** @var Vtiger_Field_Model|null Source field model */
- 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
The method getInstance has a boolean flag argument $module, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getInstance($value, $module = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '113', column '20'). Open
'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),
- 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 '126', column '21'). Open
$query = (new \App\Db\Query())->from('vtiger_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 '183', column '69'). Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- 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 getInstanceFromBlockIdList has a boolean flag argument $moduleInstance, which is a certain sign of a Single Responsibility Principle violation. Open
public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '384', column '17'). Open
$query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');
- 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 '202', column '23'). Open
$maxSequence = (new \App\Db\Query())->from('vtiger_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 '187', column '68'). Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();
- 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 '424', column '39'). Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\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 '181', column '69'). Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- 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 '188', column '68'). Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\Db' in method 'delete'. Open
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid assigning values to variables in if clauses and the like (line '148', column '20'). Open
public function delete()
{
$db = \App\Db::getInstance();
try {
parent::delete();
- 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 getFieldDataTypeLabel uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$label = $this->fieldTypeLabel[$this->getFieldDataType()] ?? '';
}
- 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_Search_Module_Model' in method 'delete'. Open
$searchModel = Settings_Search_Module_Model::getInstance('Settings:Search');
- 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 'move'. Open
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Db' in method 'getWebserviceData'. Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\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 using static access to class '\App\Module' in method 'delete'. Open
$entityInfo = \App\Module::getEntityInfo($fldModule);
- 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 '269', column '9'). Open
public function isActiveOptionDisabled(): bool
{
if (!($sourceField = $this->getSourceField())) {
$sourceField = $this;
}
- 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 '614', column '15'). Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
- 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 updateWebserviceData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();
}
- 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\Utils' in method 'updateWebserviceData'. Open
$createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();
- 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 loadWebserviceData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$this->set('defaultvalue', $data['default_value']);
}
- 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\Cache' in method 'updateWebserviceData'. Open
\App\Cache::delete('WebserviceAppsFields', $webserviceApp);
- 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\MapCoordinates' in method 'delete'. Open
\App\Fields\MapCoordinates::reloadHandler();
- 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\Config' in method 'getFieldItemByName'. Open
'isEditableReadOnly' => !App\Config::developer('CHANGE_GENERATEDTYPE')
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'delete'. Open
\App\Log::error($ex->__toString());
- 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 move uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();
- 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
Define a constant instead of duplicating this literal "sequence - 1" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "typeofdata" 11 times. Open
'typeofdata' => 'V~O',
- 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" 16 times. Open
->andWhere(['in', 'uitype', [15, 16, 33]]);
- 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" 11 times. Open
'label' => 'LBL_ICON',
- 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
->where(['fieldname' => $fieldname])
- 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 "maximumlength" 11 times. Open
'maximumlength' => '255',
- 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 "purifyType" 11 times. Open
'purifyType' => \App\Purifier::TEXT,
- 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 "block = :olderBlockId" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal ":olderSequence" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "sequence" 11 times. Open
$newSequence = $fieldNewDetails['sequence'];
- 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 ":olderBlockId" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "fieldid" 5 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "defaultvalue" 4 times. Open
$this->set('defaultvalue', '');
- 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 "masseditable" 3 times. Open
if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) {
- 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 "serverid" 3 times. Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];
- 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 "image" 3 times. Open
'image' => 'Image',
- 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_" 3 times. Open
$db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal ":newSequence" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "column" 12 times. Open
$columnName = $this->get('column');
- 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 "block" 3 times. Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "vtiger_field" 10 times. Open
$query = (new \App\Db\Query())->from('vtiger_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 "presence" 4 times. Open
->where(['block' => $blockId, 'presence' => [0, 2]])->max('sequence');
- 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
if (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {
- 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 "w_#__fields_server" 3 times. Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];
- 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 "multiImage" 3 times. Open
'multiImage' => 'MultiImage',
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Avoid unused parameters such as '$viewName'. Open
public function isEditable(string $viewName = 'Edit'): bool
- 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
Call to undeclared method \App\Db\Query::from
Open
$query = (new \App\Db\Query())->from('vtiger_field')
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Argument 1 (value)
is int
but \Settings_LayoutEditor_Field_Model::getInstance()
takes string
defined at /code/modules/Settings/LayoutEditor/models/Field.php:359
Open
$fieldInstance = self::getInstance($fieldId);
- Exclude checks
Reference to undeclared property \CRMEntity->mandatory_fields
Open
$compulsoryMandatoryFieldList = $this->getModule()->getEntityInstance()->mandatory_fields ?? [];
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Expected @param annotation for blockId
to be before the @param annotation for moduleInstance
Open
* @param Vtiger_Module_Model $moduleInstance
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_picklist', ['name' => $fieldname])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_convertleadmapping', ['leadfid' => $id])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$createCommand = \App\Db::getInstance('webservice')->createCommand();
- Exclude checks
Argument 2 (key)
is int
but \App\Cache::delete()
takes string
defined at /code/app/Cache.php:105
Open
\App\Cache::delete('WebserviceAppsFields', $webserviceApp);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->dropColumn($tablename, $columnName)->execute();
- Exclude checks
Call to undeclared method \App\Db\Query::select
Open
'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_cvcolumnlist', [
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Call to method reloadHandler
from undeclared class \App\Fields\MapCoordinates
Open
\App\Fields\MapCoordinates::reloadHandler();
- Exclude checks
Saw unextractable annotation for comment '* @param <type> $module - optional - module instance'</type>
Open
* @param <type> $module - optional - module instance
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$maxSequence = (new \App\Db\Query())->from('vtiger_field')
- Exclude checks
Call to undeclared method \Vtiger_Field_Model::setSourceField
Open
$itemModel = \Vtiger_Field_Model::init($qualifiedModuleName, $params, $name)->setSourceField($this);
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Default value for \Vtiger_Module_Model
$moduleInstance
can't be false
Open
public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)
- Exclude checks
Call to method __construct
from undeclared class \yii\db\Expression
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Returning type null
but getFieldItemByName()
is declared to return \Vtiger_Field_Model
Open
return $itemModel;
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param array List of block ids':
after array,
did not see an element name (will guess based on comment order) Open
* @param array List of block ids
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];
- Exclude checks
Saw unextractable annotation for comment '* @param <array> $fieldNewDetails'</array>
Open
* @param <Array> $fieldNewDetails
- Exclude checks
Saw unextractable annotation for comment '* @param <array> $fieldOlderDetails'</array>
Open
* @param <Array> $fieldOlderDetails
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->dropTable('vtiger_' . $fieldname . '_seq')->execute();
- Exclude checks
Call to method error
from undeclared class \App\Log
Open
\App\Log::error($ex->__toString());
- Exclude checks
Avoid excessively long variable names like $compulsoryMandatoryFieldList. Keep variable name length under 20. Open
$compulsoryMandatoryFieldList = [];
- 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_Field_Model extends Settings_Vtiger_Field_Model
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
The class Settings_LayoutEditor_Field_Model is not named in CamelCase. Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
{
/** @var Settings_Vtiger_Field_Model[] Item field models */
private $items = [];
/** @var Vtiger_Field_Model|null Source field model */
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Avoid variables with short names like $id. Configured minimum length is 3. Open
$id = $this->getId();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = \App\Db::getInstance();
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Terminating statement must be indented to the same level as the CASE body Open
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
const WEBSERVICE_APPS_VISIBILITY = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
1 => 'LBL_DISPLAY_TYPE_1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
2 => 'LBL_DISPLAY_TYPE_2',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'string' => 'Text',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
0 => 'LBL_WSA_VISIBILITY_DEFAULT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'email' => 'Email',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
private $items = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'percentage' => 'Percent',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'phone' => 'Phone',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'url' => 'URL',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
3 => 'LBL_DISPLAY_TYPE_3',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var Settings_Vtiger_Field_Model[] Item field models */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'time' => 'Time',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'picklist' => 'Picklist',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
10 => 'LBL_DISPLAY_TYPE_10',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'text' => 'TextArea',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
6 => 'LBL_DISPLAY_TYPE_6',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multipicklistTags' => 'MultipicklistTags',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $sourceFieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var Vtiger_Field_Model|null Source field model */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Webservice app visibility */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'date' => 'Date',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
4 => 'LBL_DISPLAY_TYPE_4',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
9 => 'LBL_DISPLAY_TYPE_9',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Translations of field types */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'double' => 'Decimal',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'integer' => 'Integer',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $fieldTypeLabel = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to remove field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function delete()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
try {
- 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' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$searchModel->save($params);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::error($ex->__toString());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($newSequence > $olderSequence) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ($newSequence < $olderSequence) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'token' => 'Token',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_convertleadmapping', ['leadfid' => $id])->execute();
- 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
} catch (\Throwable $ex) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newBlockId = $fieldNewDetails['blockId'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'reference' => 'Related1M',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'group' => 'Group'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get field data type label.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldname = $this->getName();
- 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 <Array> $fieldNewDetails
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$olderSequence = $fieldOlderDetails['sequence'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'image' => 'Image',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'smtp' => 'Smtp',
- Exclude checks
Spaces must 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 ('vtiger_crmentity' !== $tablename) {
- Exclude checks
Line exceeds 120 characters; contains 134 characters Open
$db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Line exceeds 120 characters; contains 132 characters Open
$db->createCommand()->delete('u_#__cv_condition', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->andWhere(['in', 'uitype', [15, 16, 33]]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (false !== ($fieldNameKey = array_search($fieldname, $entityInfo[$key]))) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to Move the field.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiReferenceValue' => 'MultiReferenceValue',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiEmail' => 'MultiEmail',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'advPercentage' => 'AdvPercentage',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('Leads' === $fldModule) {
- Exclude checks
Spaces must 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> $fieldOlderDetails
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$olderBlockId = $fieldOlderDetails['blockId'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiDomain' => 'MultiDomain',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** @var array Webservice field data */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (300 === $this->getUIType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fldModule = $this->getModuleName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db = \App\Db::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'datetime' => 'DateTime',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiReference' => 'MultiReference',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
protected $webserviceData;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$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
'multipicklist' => 'MultiSelectCombo',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->dropColumn($tablename, $columnName)->execute();
- Exclude checks
Line exceeds 120 characters; contains 163 characters Open
App\Db::getInstance('admin')->createCommand()->delete('a_#__mapped_fields', ['or', ['source' => (string) $id], ['target' => (string) $id]])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//we have to remove the entries in customview and report related tables which have this field ($colName)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//Deleting from convert lead mapping vtiger_table- Jaguar
- Exclude checks
Line exceeds 120 characters; contains 147 characters Open
$db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'rangeTime' => 'RangeTime',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'twitter' => 'Twitter',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 130 characters Open
'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$dataReader->count()) {
- 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
$searchModel = Settings_Search_Module_Model::getInstance('Settings:Search');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function move($fieldNewDetails, $fieldOlderDetails)
- Exclude checks
Line exceeds 120 characters; contains 323 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Line exceeds 120 characters; contains 129 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'serverAccess' => 'ServerAccess',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiAttachment' => '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
$columnName = $this->get('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
throw $ex;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'userCreator' => 'LBL_USER',
- Exclude checks
Spaces must 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 getFieldDataTypeLabel(): string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'source_field_name' => $fieldname,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_convertleadmapping', [$mapDelId[$fldModule] => 0], [$mapDelId[$fldModule] => $id])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->dropTable('vtiger_' . $fieldname)->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'value' => $entityInfo[$key],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'country' => 'Country',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'currency' => 'Currency',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$label = 'Editor';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$label = $this->fieldTypeLabel[$this->getFieldDataType()] ?? '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tabId = $this->getModuleId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif ('Accounts' === $fldModule) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($db->isTableExists('vtiger_' . $fieldname . '_seq')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach (['fieldnameArr' => 'fieldname', 'searchcolumnArr' => 'searchcolumn'] as $key => $name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
unset($entityInfo[$key][$fieldNameKey]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tabid' => $tabId,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$newSequence = $fieldNewDetails['sequence'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'sequence <= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'languages' => 'LBL_LANGUAGE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'boolean' => 'Checkbox',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->dropTable('vtiger_' . $fieldname . '_seq')->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Fields\MapCoordinates::reloadHandler();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Line exceeds 120 characters; contains 323 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence + 1')], ['and', 'sequence < :olderSequence', 'sequence >= :newSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':newSequence' => $newSequence, ':olderBlockId' => $olderBlockId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'categoryMultipicklist' => 'CategoryMultipicklist',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'multiImage' => 'MultiImage',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'mapCoordinates' => 'MapCoordinates',
- 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
$id = $this->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$tablename = $this->get('table');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'cvid' => (new \App\Db\Query())->select(['cvid'])->from('vtiger_customview')->where(['entitytype' => $fldModule]),
- 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
case 'multipicklist':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->from('vtiger_field')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['fieldname' => $fieldname])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_picklist', ['name' => $fieldname])->execute();
- 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
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
parent::delete();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_cvcolumnlist', ['field_name' => $fieldname, 'module_name' => $fldModule])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->delete('vtiger_cvcolumnlist', [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$mapDelId = ['Accounts' => 'accountfid'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($this->getFieldDataType()) {
- 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
$entityInfo = \App\Module::getEntityInfo($fldModule);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->set('presence', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance->save();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Vtiger_Field_Model $fieldModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Vtiger_Field_Model|null
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isActiveOptionDisabled(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!($sourceField = $this->getSourceField())) {
- Exclude checks
Spaces must 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
'skype' => 'Skype',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'tree' => 'Tree',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $label;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
//To Delete Sequence Table
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($olderBlockId == $newBlockId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$maxSequence = (new \App\Db\Query())->from('vtiger_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
*/
- Exclude checks
Spaces must 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 true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isSummaryFieldOptionDisabled()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool true/false
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($fieldIdsList as $fieldId) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->getSourceField() ? $this->getSourceField()->getModule() : parent::getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function which will specify whether the active option is disabled.
- Exclude checks
Spaces must 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 70 === $this->get('uitype');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function setSourceField(Vtiger_Field_Model $fieldModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->sourceFieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
return \in_array($this->getName(), $compulsoryMandatoryFieldList) || \in_array($this->get('uitype'), ['4', '70']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
if (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {
- 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 !(\in_array($this->get('uitype'), ['4', '70']) || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType());
- Exclude checks
Line exceeds 120 characters; contains 259 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->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
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
if (!$this->getSourceField()) {
- 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 false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function which will specify whether the default value option is disabled.
- 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
/**
- Exclude checks
Spaces must 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 (0 == $this->get('quickcreate') || 3 == $this->get('quickcreate') || !$moduleModel->isQuickCreateSupported()) {
- Exclude checks
Spaces must 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->isMandatoryOptionDisabled() || $this->isReferenceField() || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType()) {
- Exclude checks
Spaces must 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
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence > :olderSequence', 'block = :olderBlockId'], [':olderSequence' => $olderSequence, ':olderBlockId' => $olderBlockId])->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
++$maxSequence;
- Exclude checks
Spaces must 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 getModule()
- Exclude checks
Spaces must 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 specifies whether the field can have mandatory switch to happen.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$compulsoryMandatoryFieldList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return \in_array($this->getName(), $compulsoryMandatoryFieldList) || \in_array($this->get('uitype'), ['4', '70']);
- Exclude checks
Line exceeds 120 characters; contains 140 characters Open
return 0 === (int) $sourceField->get('presence') || 306 === (int) $sourceField->get('uitype') || $this->isMandatoryOptionDisabled();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function which will specify whether the mass edit option is disabled.
- Exclude checks
Spaces must 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 $viewName
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isEditable(string $viewName = 'Edit'): 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
* @return $this
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->sourceFieldModel = $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isMandatoryOptionDisabled(): bool
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$compulsoryMandatoryFieldList = $this->getModule()->getEntityInstance()->mandatory_fields ?? [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return 0 === (int) $sourceField->get('presence') || 306 === (int) $sourceField->get('uitype') || $this->isMandatoryOptionDisabled();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isDefaultValueForWebservice(): 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
Line exceeds 120 characters; contains 153 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* A function that will determine if the default value option is disabled for an WebserviceApps configuration.
- Exclude checks
Spaces must 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(['block' => $blockId, 'presence' => [0, 2]])->max('sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool
- Exclude checks
Spaces must 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
Line exceeds 120 characters; contains 248 characters Open
$db->createCommand()->update('vtiger_field', ['sequence' => new \yii\db\Expression('sequence - 1')], ['and', 'sequence >= :newSequence', 'block = :newBlockId'], [':newSequence' => $newSequence, ':newBlockId' => $newBlockId])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int[] $fieldIdsList
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function makeFieldActive($fieldIdsList, $blockId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Set source 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
}
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check whether summary field option is disable or not.
- Exclude checks
Spaces must 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
$sourceField = $this;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleModel = $this->getModule();
- Exclude checks
Spaces must 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 isMassEditOptionDisabled()
- Exclude checks
Spaces must 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 150 characters Open
return !(\in_array($this->get('uitype'), ['4', '70']) || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInstance = self::getInstance($fieldId);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get module model.
- Exclude checks
Line exceeds 120 characters; contains 165 characters Open
if ($this->isMandatoryOptionDisabled() || $this->isReferenceField() || 'image' === $this->getFieldDataType() || 'multiImage' === $this->getFieldDataType()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool true/false
- 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
$fieldInstance->set('sequence', $maxSequence);
- Exclude checks
Spaces must 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 getSourceField(): ?Vtiger_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
* Function which will specify whether the quickcreate option is disabled.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (0 == $this->get('masseditable') || 1 != $this->get('displaytype') || 3 == $this->get('masseditable')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$db->createCommand()->update('vtiger_field', ['sequence' => $newSequence, 'block' => $newBlockId], ['fieldid' => $this->getId()])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to activate field.
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get source field model.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return bool - true if we can make a field mandatory and non mandatory , false if we cant change previous state
- Exclude checks
Spaces must 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 isQuickCreateOptionDisabled()
- 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
$objectProperties = get_object_vars($fieldObject);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
foreach ($objectProperties as $properName => $propertyValue) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$blockId = [$blockId];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$query = (new \App\Db\Query())->from('vtiger_field')->where(['block' => $blockId])->orderBy('sequence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get instance.
- Exclude checks
Spaces must 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
$fieldModel->setModule($moduleInstance);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get all fields list for all blocks.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInfo = parent::getFieldInfo();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getWebserviceData(int $webserviceApp): array
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->webserviceData;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Update webservice data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->items[$name];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => \App\Purifier::TEXT,
- 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
$fieldObject = parent::getInstance($value, $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param array List of block ids
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $value - fieldname or fieldid
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param Vtiger_Module_Model $moduleInstance
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = $this->getWebserviceData($webserviceApp);
- Exclude checks
Spaces must 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->set('defaultvalue', '');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$createCommand = \App\Db::getInstance('webservice')->createCommand();
- Exclude checks
Spaces must 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
'name' => $name,
- Exclude checks
Line exceeds 120 characters; contains 269 characters Open
if ('ModComments' === $this->getModuleName() && \in_array($this->getName(), ['commentcontent', 'userid', 'created_user_id', 'customer', 'reasontoedit', 'parents', 'assigned_user_id', 'creator', 'modifiedtime', 'related_to', 'createdtime', 'parent_comments'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->{$properName} = $propertyValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromBlockIdList($blockId, $moduleInstance = false)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return array List of Field models Settings_LayoutEditor_Field_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $webserviceApp
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$createCommand->update('w_#__fields_server', $data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->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
$fieldInfo['isSummaryFieldDisabled'] = $this->isSummaryFieldOptionDisabled();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must 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 $data
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($this->getWebserviceData($webserviceApp)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldItemByName($name)
- 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
$fieldModel = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!\is_array($blockId)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel->initialize($row);
- Exclude checks
Spaces must 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 $webserviceApp
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Load webservice 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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'uitype' => 62,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'table' => 'vtiger_field',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'fieldDataType' => 'icon'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ('ModComments' === $this->getModuleName() && \in_array($this->getName(), ['commentcontent', 'userid', 'created_user_id', 'customer', 'reasontoedit', 'parents', 'assigned_user_id', 'creator', 'modifiedtime', 'related_to', 'createdtime', 'parent_comments'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $blockId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Line exceeds 120 characters; contains 204 characters Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];
- 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
* @return self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModelsList = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($moduleInstance) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!empty($data['visibility'])) {
- 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
* Get fields instance by 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
public function isDefaultValueOptionDisabled(): 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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModelsList[$row['fieldname']] = $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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->set('displaytype', $data['visibility']);
- 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
if (isset($this->items[$name])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$qualifiedModuleName = 'Settings:LayoutEditor';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($name) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => '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
}
- 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
return $fieldModelsList;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get webservice 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_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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'icon':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '255',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param <type> $module - optional - module instance
- 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
$dataReader->close();
- 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
$this->set('defaultvalue', $data['default_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
$createCommand->update('w_#__fields_server', $data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->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
'name' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldInfo(): 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
if (isset($this->webserviceData)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->webserviceData = (new \App\Db\Query())->from('w_#__fields_server')->where(['fieldid' => $this->getId(), 'serverid' => $webserviceApp])->one(\App\Db::getInstance('webservice')) ?: [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($data['is_default'])) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Cache::delete('WebserviceAppsFields', $webserviceApp);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_ICON',
- 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' => 'LBL_HEADER_FIELD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_MASS_EDIT',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- 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
return $itemModel;
- 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
$fieldInfo['isQuickCreateDisabled'] = $this->isQuickCreateOptionDisabled();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInfo['isMassEditDisabled'] = $this->isMassEditOptionDisabled();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $fieldInfo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function loadWebserviceData(int $webserviceApp): void
- 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
case 'mandatory':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (($defaultValue = $itemModel->get('defaultvalue')) !== null) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstance($value, $module = false)
- 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
* @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
public function updateWebserviceData(array $data, int $webserviceApp): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$createCommand->insert('w_#__fields_server', \App\Utils::merge($data, ['fieldid' => $this->getId(), 'serverid' => $webserviceApp]))->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$itemModel = null;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInfo['isSummaryField'] = $this->isSummaryField();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldInfo['isDefaultValueDisabled'] = $this->isDefaultValueOptionDisabled();
- Exclude checks
Spaces must 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 string $name
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $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
'column' => $name,
- 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
'tooltip' => 'LBL_FIELD_MASK_INFO'
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_LABEL',
- 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
'uitype' => 56,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => \App\Purifier::BOOL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- 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
break;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '25',
- 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
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
$params = [
- 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
case 'generatedtype':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- 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
case 'quickcreate':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- 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
'maximumlength' => '1',
- 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
'maximumlength' => '1',
- 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
$itemModel->set('fieldvalue', $this->get($name));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_QUICK_CREATE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => \App\Purifier::BOOL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => \App\Purifier::BOOL
- 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
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_FIELD_MASK',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'purifyType' => \App\Purifier::TEXT,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'V~M',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'presence':
- 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
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- 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
'purifyType' => \App\Purifier::BOOL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- 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
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- 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
];
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$itemModel = \Vtiger_Field_Model::init($qualifiedModuleName, $params, $name)->setSourceField($this);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (null !== $this->get($name)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '50',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$params = [
- 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
case 'header_field':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~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
case 'fieldMask':
- 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
$itemModel->set('fieldvalue', $defaultValue);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_ACTIVE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~O',
- 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
'label' => 'LBL_DEFAULT_VALUE',
- 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
'purifyType' => \App\Purifier::BOOL
- 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
'purifyType' => \App\Purifier::BOOL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_SUMMARY_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
'purifyType' => \App\Purifier::BOOL,
- 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
'purifyType' => \App\Purifier::TEXT
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- 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
'purifyType' => \App\Purifier::BOOL
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'maximumlength' => '1',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => '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
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
'label' => 'LBL_MANDATORY_FIELD',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'summaryfield':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'typeofdata' => 'C~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
break;
- 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
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'column' => $name,
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'masseditable':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'label' => 'LBL_GENERATED_TYPE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
'isEditableReadOnly' => !App\Config::developer('CHANGE_GENERATEDTYPE')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
case 'defaultvalue':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
];
- Exclude checks
Class name "Settings_LayoutEditor_Field_Model" is not in camel caps format Open
class Settings_LayoutEditor_Field_Model extends Settings_Vtiger_Field_Model
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 28 Open
}
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 24 Open
if (!$dataReader->count()) {
- Exclude checks
Line indented incorrectly; expected 16 spaces, found 20 Open
case 'mapCoordinates':
- Exclude checks
Line indented incorrectly; expected 20 spaces, found 24 Open
}
- Exclude checks
Line indented incorrectly; expected 24 spaces, found 28 Open
if ($db->isTableExists('vtiger_' . $fieldname . '_seq')) {
- Exclude checks