src/Models/User.php
Avoid using static access to class '\EscolaLms\Webinar\Tests\Database\Factories\UserFactory' in method 'newFactory'. Open
Open
return UserFactory::new();
- 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 new
from undeclared class \EscolaLms\Webinar\Tests\Database\Factories\UserFactory
Open
Open
return UserFactory::new();
- Exclude checks
Class extends undeclared class \EscolaLms\Auth\Models\User
(Did you mean class \EscolaLms\Webinar\Models\User) Open
Open
class User extends AuthUser
- Exclude checks