modules/Users/workflows/UsersWorkflow.php
Avoid using static access to class '\App\Mailer' in method 'newUser'. Open
Open
\App\Mailer::sendFromTemplate([
'template' => 'NewUser',
'moduleName' => $recordModel->getModuleName(),
'recordId' => $recordModel->getId(),
'to' => $recordModel->get('email1'),
- 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
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class UsersWorkflow
- 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
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'to' => $recordModel->get('email1'),
- 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
'password' => $recordModel->get('user_password'),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
\App\Mailer::sendFromTemplate([
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \Vtiger_Record_Model $recordModel
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Send email after creating a new user.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'moduleName' => $recordModel->getModuleName(),
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public static function newUser(Vtiger_Record_Model $recordModel)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'template' => 'NewUser',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'recordId' => $recordModel->getId(),
- Exclude checks