database/factories/WebinarFactory.php
Avoid using static access to class '\EscolaLms\Webinar\Enum\WebinarStatusEnum' in method 'definition'. Open
Open
'status' => $this->faker->randomElement(WebinarStatusEnum::getValues()),
- 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 extends undeclared class \Illuminate\Database\Eloquent\Factories\Factory
Open
Open
class WebinarFactory extends Factory
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'yt_url' => $this->faker->url,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'yt_stream_url' => $this->faker->url,
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'name' => $this->faker->sentence(10),
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'description' => $this->faker->sentence,
- Exclude checks
Possibly zero references to use statement for classlike/namespace User
(\EscolaLms\Auth\Models\User)
Open
Open
use EscolaLms\Auth\Models\User;
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'yt_id' => $this->faker->word,
- Exclude checks
Possibly zero references to use statement for classlike/namespace UserRole
(\EscolaLms\Core\Enums\UserRole)
Open
Open
use EscolaLms\Core\Enums\UserRole;
- Exclude checks
Reference to undeclared property \EscolaLms\Webinar\Database\Factories\WebinarFactory->faker
Open
Open
'status' => $this->faker->randomElement(WebinarStatusEnum::getValues()),
- Exclude checks
Call to undeclared function \now()
Open
Open
$now = now();
- Exclude checks
Static call to undeclared method \EscolaLms\Webinar\Enum\WebinarStatusEnum::getValues
Open
Open
'status' => $this->faker->randomElement(WebinarStatusEnum::getValues()),
- Exclude checks