modules/Settings/Currency/models/Module.php
Avoid using static access to class '\App\Fields\Currency' in method 'delete'. Open
Open
\App\Fields\Currency::clearCache();
- 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
Call to undeclared method \App\Db::createCommand
Open
Open
\App\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->execute();
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks
The class Settings_Currency_Module_Model is not named in CamelCase. Open
Open
class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model
{
const TABLE_NAME = 'vtiger_currency_info';
public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',
- 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
public function getCreateRecordUrl()
- 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
return false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return 'javascript:Settings_Currency_Js.triggerAdd(event)';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
const TABLE_NAME = 'vtiger_currency_info';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
\App\Fields\Currency::clearCache();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function delete($recordId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'conversion_rate' => 'Conversion Rate', 'currency_status' => 'Status', ];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function isPagingSupported()
- 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
\App\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->execute();
- 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
public function getBaseTable()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Line exceeds 120 characters; contains 128 characters Open
Open
public $listFields = ['currency_name' => 'Currency Name', 'currency_code' => 'Currency Code', 'currency_symbol' => 'Symbol',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $name = 'Currency';
- Exclude checks
Line exceeds 120 characters; contains 124 characters Open
Open
\App\Db::getInstance()->createCommand()->update(self::TABLE_NAME, ['deleted' => 1], ['id' => $recordId])->execute();
- 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
return self::TABLE_NAME;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Class name "Settings_Currency_Module_Model" is not in camel caps format Open
Open
class Settings_Currency_Module_Model extends Settings_Vtiger_Module_Model
- Exclude checks