modules/Settings/Log/views/LogsViewer.php
Avoid using undefined variables such as '$logsViewerColumnMapping' which will lead to PHP notices. Open
Open
$viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('TYPE', $type);
- Exclude checks
Reference to static property logsViewerColumnMapping
from undeclared class \App\Log
Open
Open
$viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
Open
$viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View
- Exclude checks
The class Settings_Log_LogsViewer_View is not named in CamelCase. Open
Open
class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View
{
/**
* Function gets module settings.
*
- 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 process(App\Request $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
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('MAPPING', \App\Log::$logsViewerColumnMapping[$type]);
- 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
* Function gets module settings.
- 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->view('LogsViewer.tpl', $request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$type = $request->has('type') ? $request->getByType('type', 'Text') : 'magento';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \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->assign('TYPE', $type);
- Exclude checks
Class name "Settings_Log_LogsViewer_View" is not in camel caps format Open
Open
class Settings_Log_LogsViewer_View extends Settings_Vtiger_Index_View
- Exclude checks