EscolaLMS/Consultations

View on GitHub
database/factories/ConsultationFactory.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\EscolaLms\Consultations\Enum\ConsultationStatusEnum' in method 'definition'.
Open

            'status' => $this->faker->randomElement(ConsultationStatusEnum::getValues()),

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\Enum\ConsultationStatusEnum::getValues
Open

            'status' => $this->faker->randomElement(ConsultationStatusEnum::getValues()),
Severity: Critical
Found in database/factories/ConsultationFactory.php by phan

Call to undeclared function \now()
Open

        $now = now();
Severity: Critical
Found in database/factories/ConsultationFactory.php by phan

Reference to undeclared property \EscolaLms\Consultations\Database\Factories\ConsultationFactory->faker
Open

            'description' => $this->faker->sentence,

Call to method role from undeclared class \EscolaLms\Auth\Models\User (Did you mean class \EscolaLms\Consultations\Models\User)
Open

        $tutor = User::role(UserRole::TUTOR)->inRandomOrder()->first();
Severity: Critical
Found in database/factories/ConsultationFactory.php by phan

Class extends undeclared class \Illuminate\Database\Eloquent\Factories\Factory
Open

class ConsultationFactory extends Factory
Severity: Critical
Found in database/factories/ConsultationFactory.php by phan

Reference to undeclared property \EscolaLms\Consultations\Database\Factories\ConsultationFactory->faker
Open

            'status' => $this->faker->randomElement(ConsultationStatusEnum::getValues()),

Reference to undeclared property \EscolaLms\Consultations\Database\Factories\ConsultationFactory->faker
Open

            'name' => $this->faker->sentence(10),

Reference to constant TUTOR from undeclared class \EscolaLms\Core\Enums\UserRole
Open

        $tutor = User::role(UserRole::TUTOR)->inRandomOrder()->first();
Severity: Critical
Found in database/factories/ConsultationFactory.php by phan

Reference to undeclared property \EscolaLms\Consultations\Database\Factories\ConsultationFactory->faker
Open

            'short_desc' => $this->faker->sentence,

There are no issues that match your filters.

Category
Status