Missing class import via use statement (line '25', column '23'). Open
$registration = new \App\YetiForce\Register();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\YetiForce\Register' in method 'process'. Open
$viewer->assign('IS_REGISTERED', \App\YetiForce\Register::isRegistered());
- 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_Companies_Record_Model' in method 'process'. Open
$recordModel = Settings_Companies_Record_Model::getInstance();
- 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 'process'. Open
$viewer->assign('STATUS', \App\Language::translate($status, $module));
- 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 method getStatus
from undeclared class \App\YetiForce\Register
Open
$status = \App\YetiForce\Register::STATUS_MESSAGES[$registration->getStatus(true)];
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('IS_REGISTERED', \App\YetiForce\Register::isRegistered());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RECORD_ID', $recordModel->getId());
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('EMAIL_URL', Settings_Companies_EmailVerificationModal_View::MODAL_EVENT['url']);
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('STATUS', \App\Language::translate($status, $module));
- Exclude checks
Reference to constant MODAL_EVENT
from undeclared class \Settings_Companies_EmailVerificationModal_View
Open
$viewer->assign('EMAIL_URL', Settings_Companies_EmailVerificationModal_View::MODAL_EVENT['url']);
- Exclude checks
Call to method isRegistered
from undeclared class \App\YetiForce\Register
Open
$viewer->assign('IS_REGISTERED', \App\YetiForce\Register::isRegistered());
- Exclude checks
Reference to constant STATUS_MESSAGES
from undeclared class \App\YetiForce\Register
Open
$status = \App\YetiForce\Register::STATUS_MESSAGES[$registration->getStatus(true)];
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('STATUS_ERROR', $registration->getError());
- Exclude checks
Call to method getCurrentUserModel
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
if (\App\User::getCurrentUserModel()->isAdmin()) {
- Exclude checks
Call to undeclared method \Vtiger_Viewer::assign
Open
$viewer->assign('RECORD_MODEL', $recordModel);
- Exclude checks
Call to method __construct
from undeclared class \App\YetiForce\Register
Open
$registration = new \App\YetiForce\Register();
- Exclude checks
Call to method getError
from undeclared class \App\YetiForce\Register
Open
$viewer->assign('STATUS_ERROR', $registration->getError());
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Settings_Companies_Edit_View extends Settings_Vtiger_Index_View
- Exclude checks
The class Settings_Companies_Edit_View is not named in CamelCase. Open
class Settings_Companies_Edit_View extends Settings_Vtiger_Index_View
{
/**
* {@inheritdoc}
*/
- 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
$viewer->assign('EMAIL_URL', Settings_Companies_EmailVerificationModal_View::MODAL_EVENT['url']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('STATUS', \App\Language::translate($status, $module));
- 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
* {@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
$module = $request->getModule(false);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$recordModel = Settings_Companies_Record_Model::getInstance();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RECORD_MODEL', $recordModel);
- 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
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$registration = new \App\YetiForce\Register();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$status = \App\YetiForce\Register::STATUS_MESSAGES[$registration->getStatus(true)];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('RECORD_ID', $recordModel->getId());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('STATUS_ERROR', $registration->getError());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if (\App\User::getCurrentUserModel()->isAdmin()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$viewer->assign('IS_REGISTERED', \App\YetiForce\Register::isRegistered());
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function process(App\Request $request): void
- 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
$viewer->view('EditView.tpl', $module);
- 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 $pageTitle = 'LBL_EDIT';
- Exclude checks
Class name "Settings_Companies_Edit_View" is not in camel caps format Open
class Settings_Companies_Edit_View extends Settings_Vtiger_Index_View
- Exclude checks