modules/Vtiger/inventoryfields/ItemNumber.php
Missing class import via use statement (line '30', column '14'). Open
Open
throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField
- Exclude checks
The class Vtiger_ItemNumber_InventoryField is not named in CamelCase. Open
Open
class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField
{
protected $type = 'ItemNumber';
protected $defaultLabel = 'LBL_ITEM_NUMBER';
protected $columnName = 'seq';
- 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
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $columnName = 'seq';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return (int) $value;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function getDBValue($value, ?string $name = '')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function validate($value, string $columnName, bool $isUserFormat, $originalValue = null)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $type = 'ItemNumber';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $defaultLabel = 'LBL_ITEM_NUMBER';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ($value && (!is_numeric($value) || (string) $value !== (string) filter_var($value, FILTER_VALIDATE_INT))) {
- Exclude checks
Line exceeds 120 characters; contains 143 characters Open
Open
throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $purifyType = \App\Purifier::INTEGER;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
throw new \App\Exceptions\Security('ERR_ILLEGAL_FIELD_VALUE||' . $columnName . '||' . $this->getModuleName() . '||' . $value, 406);
- Exclude checks
Class name "Vtiger_ItemNumber_InventoryField" is not in camel caps format Open
Open
class Vtiger_ItemNumber_InventoryField extends Vtiger_Basic_InventoryField
- Exclude checks