Function getInstance
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getInstance($value, $module = false, $type = '')
{
switch ($type) {
case 'SELF':
$fieldModel = parent::getInstance($value, $module);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method getInstance
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getInstance($value, $module = false, $type = '')
{
switch ($type) {
case 'SELF':
$fieldModel = parent::getInstance($value, $module);
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, $type = '')
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
\App\Log::warning('Not found field: ' . $value, 'MappedFields');
}
- 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
The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$return = self::getInstanceFromInventoryFieldObject($inventoryField);
}
- 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_MappedFields_Module_Model' in method 'getInstance'. Open
$fields = Settings_MappedFields_Module_Model::getSpecialFields();
- 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 'getInstance'. Open
\App\Log::warning('Not found inventory field: ' . $value, 'MappedFields');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Vtiger_Inventory_Model' in method 'getInstance'. Open
$inventoryModel = Vtiger_Inventory_Model::getInstance($module->getName());
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\App\Log' in method 'getInstance'. Open
\App\Log::warning('Not found field: ' . $value, 'MappedFields');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Define a constant instead of duplicating this literal "label" 4 times. Open
$row['label'] = $fieldModel->getFieldLabel();
- 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" 4 times. Open
if (empty($this->fieldDataType) && 'INVENTORY' == $this->get('typeofdata')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Define a constant instead of duplicating this literal "INVENTORY" 3 times. Open
if (empty($this->fieldDataType) && 'INVENTORY' == $this->get('typeofdata')) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Call to method warning
from undeclared class \App\Log
Open
\App\Log::warning('Not found field: ' . $value, 'MappedFields');
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_mappedfields_field_model> field model'</settings_mappedfields_field_model>
Open
* @return <Settings_MappedFields_Field_Model> field model
- Exclude checks
Call to method getName
on non-class type false|string
Open
$inventoryModel = Vtiger_Inventory_Model::getInstance($module->getName());
- Exclude checks
Declaration of function getUIType() : string
should be compatible with function getUIType() : int
defined in /code/modules/Vtiger/models/Field.php:255
Open
public function getUIType()
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_mappedfields_field_model>'</settings_mappedfields_field_model>
Open
* @return <Settings_MappedFields_Field_Model>
- Exclude checks
Call to deprecated function \Vtiger_Field_Model::getFieldName()
defined at /code/modules/Vtiger/models/Field.php:203
Open
$row['name'] = $fieldModel->getFieldName();
- Exclude checks
Default value for string
$module
can't be false
Open
public static function getInstance($value, $module = false, $type = '')
- Exclude checks
Suspicious array access to \instance
Open
$fieldModel = $fields[$value];
- Exclude checks
Reference to undeclared property \Settings_MappedFields_Field_Model->mandatory
Open
return $this->mandatory;
- Exclude checks
Saw unextractable annotation for comment '* @param <string> $value'</string>
Open
* @param <String/Integer> $value
- Exclude checks
Returning type int
but getUIType()
is declared to return string
Open
return $this->uitype;
- Exclude checks
Call to deprecated function \Vtiger_Field_Model::getFieldLabel()
defined at /code/modules/Vtiger/models/Field.php:215
Open
$row['label'] = $fieldModel->getFieldLabel();
- Exclude checks
Reference to undeclared property \Settings_MappedFields_Field_Model->fieldModel
(Did you mean $fieldModel) Open
$instance->fieldModel = $fieldModel;
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_mappedfields_field_model>'</settings_mappedfields_field_model>
Open
* @return <Settings_MappedFields_Field_Model>
- Exclude checks
Call to method warning
from undeclared class \App\Log
Open
\App\Log::warning('Not found inventory field: ' . $value, 'MappedFields');
- Exclude checks
Saw unextractable annotation for comment '* @return <settings_mappedfields_field_model>'</settings_mappedfields_field_model>
Open
* @return <Settings_MappedFields_Field_Model>
- Exclude checks
Reference to undeclared property \Settings_MappedFields_Field_Model->mandatory
Open
$this->mandatory = parent::isMandatory();
- Exclude checks
Reference to undeclared property \Settings_MappedFields_Field_Model->mandatory
Open
if (!$this->mandatory) {
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_MappedFields_Field_Model extends Vtiger_Field_Model
- Exclude checks
The class Settings_MappedFields_Field_Model is not named in CamelCase. Open
class Settings_MappedFields_Field_Model extends Vtiger_Field_Model
{
public $inventoryField = false;
/**
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get field data type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldDataType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->fieldDataType = parent::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
return $this->uitype;
- Exclude checks
Spaces must 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->fieldDataType = 'inventory';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param mixed $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
$row = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->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
$row['label'] = $inventoryField->get('label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['typeofdata'] = 'INVENTORY';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = self::fromArray($row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = parent::getInstance($value, $module);
- 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
public function getUIType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($this->fieldDataType) && 'INVENTORY' == $this->get('typeofdata')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} elseif (empty($this->fieldDataType)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public $inventoryField = 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
* @param Vtiger_Field_Model $fieldModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->get('label');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$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
* @return string data type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->uitype = parent::getUIType();
- Exclude checks
Spaces must be used 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
* @param mixed $inventoryField
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['defaultvalue'] = $inventoryField->getDefaultValue();
- Exclude checks
Spaces must be used 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 'SELF':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = parent::getInstance($value, $module);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return parent::getFieldType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get clean 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
foreach ($row as $name => $value) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['fieldparams'] = $fieldModel->getFieldParams();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function isMandatory()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance->inventoryField = $inventoryField;
- Exclude checks
Spaces must 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($fields[$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
return $return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$objectProperties = get_object_vars($fieldModel);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (!$this->get('uitype')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get the field type.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used 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
$row['displaytype'] = $fieldModel->getDisplayType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldLabelKey()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param <String/Integer> $value
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $module
- 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
$inventoryField = $inventoryModel->getField($value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($fieldModel) {
- 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
return $fieldModel;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get field uitype.
- Exclude checks
Spaces must be used 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
$row['table'] = $fieldModel->getTableName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance->fieldModel = $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
* Function to get field 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
$return = self::getInstanceFromInventoryFieldObject($inventoryField);
- Exclude checks
Spaces must 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->fieldDataType;
- 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
* Function to get field instance from WebserviceFieldObject.
- 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
* @return <Settings_MappedFields_Field_Model> field model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fields = Settings_MappedFields_Module_Model::getSpecialFields();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$fieldModel = $fields[$value];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$return = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getFieldType()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['name'] = $fieldModel->getFieldName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['typeofdata'] = $fieldModel->get('typeofdata');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string label
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param string $type
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstance($value, $module = false, $type = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::warning('Not found inventory field: ' . $value, 'MappedFields');
- 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 string uitype
- Exclude checks
Spaces must be used 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 <Settings_MappedFields_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
$row['defaultvalue'] = $fieldModel->getDefaultFieldValue();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['mandatory'] = $fieldModel->isMandatory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$inventoryModel = Vtiger_Inventory_Model::getInstance($module->getName());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (empty($inventoryField)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get Field instance from array.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to check if the current field is mandatory 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
$row['id'] = $inventoryField->getColumnName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return string type of the field
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return Settings_MappedFields_Field_Model
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['label'] = $fieldModel->getFieldLabel();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get field instance from InventoryFieldObject.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
\App\Log::warning('Not found field: ' . $value, 'MappedFields');
- 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
return 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
* @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
* @return <Settings_MappedFields_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
public static function fromArray($row = [])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $instance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['masseditable'] = (bool) $fieldModel->get('masseditable');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance = self::fromArray($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
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = [];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['mandatory'] = $inventoryField->isMandatory();
- Exclude checks
Spaces must 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 ('id' === $this->get('name')) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['column'] = $fieldModel->getColumnName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $instance;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$this->mandatory = parent::isMandatory();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['name'] = $inventoryField->getColumnName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return <Settings_MappedFields_Field_Model>
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getCleanInstance()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromWebserviceFieldObject($fieldModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['uitype'] = $fieldModel->getUIType();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['presence'] = $fieldModel->get('presence');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getInstanceFromInventoryFieldObject($inventoryField)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
switch ($type) {
- 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
$fieldModel->{$properName} = $propertyValue;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$instance->set($name, $value);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['id'] = $fieldModel->getId();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->mandatory;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row['column'] = $inventoryField->getColumnName();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $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
case 'INVENTORY':
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
break;
- Exclude checks
Class name "Settings_MappedFields_Field_Model" is not in camel caps format Open
class Settings_MappedFields_Field_Model extends Vtiger_Field_Model
- Exclude checks