src/Models/ConsultationUserTerm.php
Avoid using static access to class '\EscolaLms\Consultations\Database\Factories\ConsultationUserTermFactory' in method 'newFactory'. Open
Open
return ConsultationUserTermFactory::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
Class uses undeclared trait \Illuminate\Database\Eloquent\Factories\HasFactory
Open
Open
class ConsultationUserTerm extends Model
- Exclude checks
Class extends undeclared class \Illuminate\Database\Eloquent\Model
Open
Open
class ConsultationUserTerm extends Model
- Exclude checks
Return type of consultationUser()
is undeclared type \Illuminate\Database\Eloquent\Relations\BelongsTo
Open
Open
public function consultationUser(): BelongsTo
- Exclude checks
Property \EscolaLms\Consultations\Models\ConsultationUserTerm->finished_at
has undeclared type \Illuminate\Support\Carbon
Open
Open
* @property Carbon $finished_at
- Exclude checks
Call to undeclared method \EscolaLms\Consultations\Models\ConsultationUserTerm::belongsTo
Open
Open
return $this->belongsTo(ConsultationUserPivot::class, 'consultation_user_id', 'id', 'consultation_user');
- Exclude checks
Static call to undeclared method \EscolaLms\Consultations\Database\Factories\ConsultationUserTermFactory::new
Open
Open
return ConsultationUserTermFactory::new();
- Exclude checks
Property \EscolaLms\Consultations\Models\ConsultationUserTerm->executed_at
has undeclared type \Illuminate\Support\Carbon
Open
Open
* @property Carbon $executed_at
- Exclude checks