YetiForceCompany/YetiForceCRM

View on GitHub
modules/Users/workflows/UsersWorkflow.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Mailer' in method 'newUser'.
Open

        \App\Mailer::sendFromTemplate([
            'template' => 'NewUser',
            'moduleName' => $recordModel->getModuleName(),
            'recordId' => $recordModel->getId(),
            'to' => $recordModel->get('email1'),

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

class UsersWorkflow

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

            'to' => $recordModel->get('email1'),

Spaces must be used to indent lines; tabs are not allowed
Open

        ]);

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

            'password' => $recordModel->get('user_password'),

Spaces must be used to indent lines; tabs are not allowed
Open

        \App\Mailer::sendFromTemplate([

Spaces must be used to indent lines; tabs are not allowed
Open

     * @param \Vtiger_Record_Model $recordModel

Spaces must be used to indent lines; tabs are not allowed
Open

     * Send email after creating a new user.

Spaces must be used to indent lines; tabs are not allowed
Open

            'moduleName' => $recordModel->getModuleName(),

Spaces must be used to indent lines; tabs are not allowed
Open

    public static function newUser(Vtiger_Record_Model $recordModel)

Spaces must be used to indent lines; tabs are not allowed
Open

            'template' => 'NewUser',

Spaces must be used to indent lines; tabs are not allowed
Open

            'recordId' => $recordModel->getId(),

There are no issues that match your filters.

Category
Status