mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-20 02:22:28 +08:00
40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Database\Factories\WpOrg;
|
|
|
|
use App\Models\WpOrg\ClosedPlugin;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
use Illuminate\Support\Str;
|
|
|
|
/** @extends Factory<ClosedPlugin> */
|
|
class ClosedPluginFactory extends Factory
|
|
{
|
|
/** @return array<string, mixed> */
|
|
public function definition(): array
|
|
{
|
|
$faker = $this->faker;
|
|
$name = $faker->words(3, true);
|
|
$slug = Str::slug($name);
|
|
|
|
$reasons = [
|
|
"author-request",
|
|
"guideline-violation",
|
|
"licensing-trademark-violation",
|
|
"merged-into-core",
|
|
"security-issue",
|
|
];
|
|
|
|
return [
|
|
'id' => $faker->uuid(),
|
|
'slug' => $slug,
|
|
'name' => $name,
|
|
'description' => $faker->sentence(),
|
|
'closed_date' => $faker->dateTimeBetween('-2 years'),
|
|
'reason' => $faker->randomElement($reasons),
|
|
'ac_raw_metadata' => null, // TODO
|
|
'ac_created' => $faker->dateTimeBetween('-1 month'),
|
|
'ac_shadow_id' => null,
|
|
];
|
|
}
|
|
}
|