modules/Settings/WebserviceUsers/views/ListViewSession.php
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_ListViewSession_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
Avoid excessively long class names like Settings_WebserviceUsers_ListViewSession_View. Keep class name length under 40. Open
Open
class Settings_WebserviceUsers_ListViewSession_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_ListViewSession_View extends \App\Controller\ModalSettings
- Exclude checks
The class Settings_WebserviceUsers_ListViewSession_View is not named in CamelCase. Open
Open
class Settings_WebserviceUsers_ListViewSession_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
public $modalIcon = 'fas fa-users-cog';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $pageTitle = 'LBL_SESSION_RECORD';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'last_method' => 'FL_LAST_METHOD',
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var array Columns to show on the list session. */
- 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
'parent_id' => 'Accounts',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'language' => 'FL_LANGUAGE',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'changed' => 'FL_DATETIME_LAST_QUERY',
- 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 $showFooter = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'created' => 'FL_LOGIN_TIME',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'params' => 'LBL_PARAMS',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static $columnsToShow = [
- 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
$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
{
- 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
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'agent' => 'LBL_USER_AGENT',
- 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
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->view('ListViewSession.tpl', $qualifiedModuleName);
- 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
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('TABLE_COLUMNS', static::$columnsToShow);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('SESSION_HISTORY_ENTRIES', $recordModel->getUserSession($container));
- 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
$qualifiedModuleName = $request->getModule(false);
- Exclude checks
Class name "Settings_WebserviceUsers_ListViewSession_View" is not in camel caps format Open
Open
class Settings_WebserviceUsers_ListViewSession_View extends \App\Controller\ModalSettings
- Exclude checks