modules/Project/views/Detail.php
Avoid using static access to class '\App\Language' in method 'showGantt'. Open
Open
$viewer->assign('GANTT_TITLE', \App\Language::translate('LBL_GANTT_TITLE', 'Project'));
- 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
Class extends undeclared class \Vtiger_Detail_View
Open
Open
class Project_Detail_View extends Vtiger_Detail_View
- Exclude checks
Reference to undeclared class \Vtiger_Detail_View
Open
Open
parent::__construct();
- Exclude checks
Call to undeclared method \Project_Detail_View::exposeMethod
Open
Open
$this->exposeMethod('showGantt');
- Exclude checks
Call to undeclared method \Project_Detail_View::getViewer
Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Call to undeclared method \Project_Detail_View::exposeMethod
Open
Open
$this->exposeMethod('showRelatedRecords');
- Exclude checks
Reference to undeclared class \Vtiger_Detail_View
Open
Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
- Exclude checks
Call to undeclared method \Project_Detail_View::checkAndConvertJsScripts
Open
Open
return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Project_Detail_View extends Vtiger_Detail_View
- Exclude checks
The class Project_Detail_View is not named in CamelCase. Open
Open
class Project_Detail_View extends Vtiger_Detail_View
{
/** {@inheritdoc} */
public function __construct()
{
- 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 __construct()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function showGantt(App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('GANTT_TITLE', \App\Language::translate('LBL_GANTT_TITLE', 'Project'));
- 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
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('MODULE_NAME', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'~libraries/chart.js/dist/Chart.js',
- 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 array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts([
- 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
*/
- 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
$this->exposeMethod('showRelatedRecords');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @throws \App\Exceptions\AppException
- 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
'modules.Project.resources.Gantt',
- 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
$this->exposeMethod('showGantt');
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @throws \App\Exceptions\IllegalValue
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'modules.Project.resources.GanttController'
- 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
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('PROJECTID', $request->getInteger('record'));
- 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 getFooterScripts(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
parent::__construct();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$moduleName = $request->getModule();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Show gantt.
- 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
'~libraries/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.js',
- 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('gantt/GanttContents.tpl', $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'~libraries/gantt-elastic/dist/bundle.js',
- Exclude checks
Class name "Project_Detail_View" is not in camel caps format Open
Open
class Project_Detail_View extends Vtiger_Detail_View
- Exclude checks