EscolaLMS/Consultations

View on GitHub
src/Models/ConsultationUserPivot.php

Summary

Maintainability
A
0 mins
Test Coverage
D
60%

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

        return ConsultationUserFactory::new();
Severity: Minor
Found in src/Models/ConsultationUserPivot.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

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

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

Reference to undeclared property \EscolaLms\Consultations\Models\ConsultationUserPivot->executed_status
Open

        return $this->executed_status === ConsultationTermStatusEnum::APPROVED;
Severity: Minor
Found in src/Models/ConsultationUserPivot.php by phan

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

        return $this->belongsTo(Consultation::class);
Severity: Critical
Found in src/Models/ConsultationUserPivot.php by phan

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

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

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

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

Reference to undeclared property \EscolaLms\Consultations\Models\ConsultationUserPivot->executed_status
Open

        return $this->executed_status === ConsultationTermStatusEnum::REJECT;
Severity: Minor
Found in src/Models/ConsultationUserPivot.php by phan

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

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

Class uses undeclared trait \Illuminate\Database\Eloquent\Factories\HasFactory
Open

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

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

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

There are no issues that match your filters.

Category
Status