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