1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace Database\Factories;
9
10use App\Models\BeatmapFailtimes;
11
12class BeatmapFailtimesFactory extends Factory
13{
14 protected $model = BeatmapFailtimes::class;
15
16 public function definition(): array
17 {
18 $array = [];
19
20 for ($i = 1; $i <= 100; $i++) {
21 $field = 'p'.strval($i);
22 $array[$field] = rand(1, 10000);
23 }
24
25 return $array;
26 }
27
28 public function fail(): static
29 {
30 return $this->state(['type' => 'fail']);
31 }
32
33 public function retry(): static
34 {
35 return $this->state(['type' => 'exit']);
36 }
37}