modules/Settings/WebserviceUsers/views/HistoryAccessActivity.php
Avoid using static access to class 'Settings_Vtiger_Module_Model' in method 'process'. Open
Open
$moduleInstance = Settings_Vtiger_Module_Model::getInstance('Settings:WebserviceUsers');
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class 'Settings_WebserviceUsers_Record_Model' in method 'process'. Open
Open
$recordModel = Settings_WebserviceUsers_Record_Model::getInstanceById($request->getInteger('record', ''), $container);
- 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 \Settings_WebserviceUsers_HistoryAccessActivity_View::getViewer
Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Argument 2 (value)
is ''
but \App\Request::getInteger()
takes int
defined at /code/app/Request.php:200
Open
Open
$recordModel = Settings_WebserviceUsers_Record_Model::getInstanceById($request->getInteger('record', ''), $container);
- Exclude checks
Reference to undeclared property \Settings_Vtiger_Module_Model->typeApi
Open
Open
$moduleInstance->typeApi = $container;
- Exclude checks
Call to undeclared method \Settings_Vtiger_Module_Model::getService
Open
Open
$viewer->assign('TABLE_COLUMNS', $moduleInstance->getService()->columnsToShow);
- Exclude checks
Avoid excessively long class names like Settings_WebserviceUsers_HistoryAccessActivity_View. Keep class name length under 40. Open
Open
class Settings_WebserviceUsers_HistoryAccessActivity_View extends \App\Controller\ModalSettings
{
/** {@inheritdoc} */
public $modalSize = 'modal-full';
- Read upRead up
- Exclude checks
LongClassName
Since: 2.9
Detects when classes or interfaces are declared with excessively long names.
Example
class ATooLongClassNameThatHintsAtADesignProblem {
}
interface ATooLongInterfaceNameThatHintsAtADesignProblem {
}
Source https://phpmd.org/rules/naming.html#longclassname
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_WebserviceUsers_HistoryAccessActivity_View extends \App\Controller\ModalSettings
- Exclude checks
The class Settings_WebserviceUsers_HistoryAccessActivity_View is not named in CamelCase. Open
Open
class Settings_WebserviceUsers_HistoryAccessActivity_View extends \App\Controller\ModalSettings
{
/** {@inheritdoc} */
public $modalSize = 'modal-full';
- 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
/** {@inheritdoc} */
- 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
public $pageTitle = 'LBL_HISTORY_ACTIVITY';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$recordModel = Settings_WebserviceUsers_Record_Model::getInstanceById($request->getInteger('record', ''), $container);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer = $this->getViewer($request);
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleInstance = Settings_Vtiger_Module_Model::getInstance('Settings:WebserviceUsers');
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
Open
$recordModel = Settings_WebserviceUsers_Record_Model::getInstanceById($request->getInteger('record', ''), $container);
- 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
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('HISTORY_ACTIVITY_ENTRIES', $recordModel->getUserHistoryAccessActivity($container));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$container = $request->getByType('typeApi', 'Alnum');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $modalSize = 'modal-full';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $modalIcon = 'yfi yfi-login-history';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $showFooter = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleInstance->typeApi = $container;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('TABLE_COLUMNS', $moduleInstance->getService()->columnsToShow);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->view('HistoryAccessActivity.tpl', $qualifiedModuleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(App\Request $request)
- 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
}
- Exclude checks
Class name "Settings_WebserviceUsers_HistoryAccessActivity_View" is not in camel caps format Open
Open
class Settings_WebserviceUsers_HistoryAccessActivity_View extends \App\Controller\ModalSettings
- Exclude checks