Avoid using static access to class '\App\Language' in method 'getPageTitle'. Open
$pageTitle = \App\Language::translate($this->pageTitle, $moduleName);
- 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 '\App\Language' in method 'getPageTitle'. Open
$pageTitle = \App\Language::translate($request->getModule(), $moduleName);
- 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
The method getPageTitle uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$pageTitle = \App\Language::translate($request->getModule(), $moduleName);
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
Class extends undeclared class \App\Controller\Modal
Open
abstract class ModalSettings extends Modal
- Exclude checks
Call to undeclared method \App\Controller\ModalSettings::checkAndConvertCssStyles
Open
return $this->checkAndConvertCssStyles([
- Exclude checks
Reference to undeclared property \App\Controller\ModalSettings->pageTitle
Open
if (isset($this->pageTitle)) {
- Exclude checks
Call to undeclared method \App\Controller\ModalSettings::checkAndConvertJsScripts
Open
return $this->checkAndConvertJsScripts([
- Exclude checks
Reference to undeclared property \App\Controller\ModalSettings->pageTitle
Open
$pageTitle = \App\Language::translate($this->pageTitle, $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get modal scripts files that need to loaded in the modal.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewName = $request->getByType('view', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$moduleName = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.{$request->getModule()}.resources.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Get modal css files that need to loaded in the modal.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->checkAndConvertCssStyles([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.Vtiger.resources.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param \App\Request $request
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.Vtiger.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $this->checkAndConvertJsScripts([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
use Traits\SettingsPermission;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Vtiger_CssScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewName = $request->getByType('view', 2);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
]);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getPageTitle(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (isset($this->pageTitle)) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $pageTitle;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getModalScripts(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getModalCss(\App\Request $request)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageTitle = \App\Language::translate($request->getModule(), $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \Vtiger_JsScript_Model[]
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
"modules.Settings.{$request->getModule()}.$viewName",
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$pageTitle = \App\Language::translate($this->pageTitle, $moduleName);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
} else {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks