EscolaLMS/Consultations

View on GitHub
src/Models/ConsultationUserTerm.php

Summary

Maintainability
A
0 mins
Test Coverage
F
50%

Avoid using static access to class '\EscolaLms\Consultations\Database\Factories\ConsultationUserTermFactory' in method 'newFactory'.
Open

        return ConsultationUserTermFactory::new();
Severity: Minor
Found in src/Models/ConsultationUserTerm.php by phpmd

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

class ConsultationUserTerm extends Model
Severity: Critical
Found in src/Models/ConsultationUserTerm.php by phan

Class extends undeclared class \Illuminate\Database\Eloquent\Model
Open

class ConsultationUserTerm extends Model
Severity: Critical
Found in src/Models/ConsultationUserTerm.php by phan

Return type of consultationUser() is undeclared type \Illuminate\Database\Eloquent\Relations\BelongsTo
Open

    public function consultationUser(): BelongsTo
Severity: Minor
Found in src/Models/ConsultationUserTerm.php by phan

Property \EscolaLms\Consultations\Models\ConsultationUserTerm->finished_at has undeclared type \Illuminate\Support\Carbon
Open

 * @property Carbon $finished_at
Severity: Minor
Found in src/Models/ConsultationUserTerm.php by phan

Call to undeclared method \EscolaLms\Consultations\Models\ConsultationUserTerm::belongsTo
Open

        return $this->belongsTo(ConsultationUserPivot::class, 'consultation_user_id', 'id', 'consultation_user');
Severity: Critical
Found in src/Models/ConsultationUserTerm.php by phan

Static call to undeclared method \EscolaLms\Consultations\Database\Factories\ConsultationUserTermFactory::new
Open

        return ConsultationUserTermFactory::new();
Severity: Critical
Found in src/Models/ConsultationUserTerm.php by phan

Property \EscolaLms\Consultations\Models\ConsultationUserTerm->executed_at has undeclared type \Illuminate\Support\Carbon
Open

 * @property Carbon $executed_at
Severity: Minor
Found in src/Models/ConsultationUserTerm.php by phan

There are no issues that match your filters.

Category
Status