|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Soliso project. |
| 5 | + * |
| 6 | + * (c) Mobizel |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +declare(strict_types=1); |
| 13 | + |
| 14 | +namespace Tests\CodingStandard; |
| 15 | + |
| 16 | +use Zenstruck\Foundry\ModelFactory; |
| 17 | +use Zenstruck\Foundry\Proxy; |
| 18 | + |
| 19 | +/** |
| 20 | + * @extends ModelFactory<Sample> |
| 21 | + * |
| 22 | + * @method static Sample|Proxy createOne(array $attributes = []) |
| 23 | + * @method static Sample[]|Proxy[] createMany(int $number, array|callable $attributes = []) |
| 24 | + * @method static Sample|Proxy find(object|array|mixed $criteria) |
| 25 | + * @method static Sample|Proxy findOrCreate(array $attributes) |
| 26 | + * @method static Sample|Proxy first(string $sortedField = 'id') |
| 27 | + * @method static Sample|Proxy last(string $sortedField = 'id') |
| 28 | + * @method static Sample|Proxy random(array $attributes = []) |
| 29 | + * @method static Sample|Proxy randomOrCreate(array $attributes = []) |
| 30 | + * @method static Sample[]|Proxy[] all() |
| 31 | + * @method static Sample[]|Proxy[] findBy(array $attributes) |
| 32 | + * @method static Sample[]|Proxy[] randomSet(int $number, array $attributes = []) |
| 33 | + * @method static Sample[]|Proxy[] randomRange(int $min, int $max, array $attributes = []) |
| 34 | + * @method Sample|Proxy create(array|callable $attributes = []) |
| 35 | + */ |
| 36 | +final class DealerFactory extends ModelFactory |
| 37 | +{ |
| 38 | + protected function getDefaults(): array |
| 39 | + { |
| 40 | + return array_merge(parent::getDefaults(), [ |
| 41 | + 'company_name' => self::faker()->company(), |
| 42 | + ]); |
| 43 | + } |
| 44 | + |
| 45 | + protected static function getClass(): string |
| 46 | + { |
| 47 | + return Dealer::class; |
| 48 | + } |
| 49 | +} |
0 commit comments