Total Complexity | 4 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class PostFactory extends ModelFactory |
||
12 | { |
||
13 | public function published(): self |
||
14 | { |
||
15 | return $this->addState(function() { |
||
16 | return ['published_at' => self::faker()->dateTime()]; |
||
17 | }); |
||
18 | } |
||
19 | |||
20 | public function withComments(): self |
||
21 | { |
||
22 | return $this->addState(function() { |
||
23 | return [ |
||
24 | 'comments' => new ArrayCollection([ |
||
25 | new Comment(new User('user'), 'body'), |
||
26 | new Comment(new User('user'), 'body'), |
||
27 | ]), |
||
28 | ]; |
||
29 | }); |
||
30 | } |
||
31 | |||
32 | protected static function getClass(): string |
||
35 | } |
||
36 | |||
37 | protected function getDefaults(): array |
||
43 | ]; |
||
44 | } |
||
46 |