CommentFactory::getDefaults()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 5
c 1
b 0
f 1
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Fixtures\Factories;
4
5
use Zenstruck\Foundry\ModelFactory;
6
use Zenstruck\Foundry\Tests\Fixtures\Entity\Comment;
7
8
final class CommentFactory extends ModelFactory
9
{
10
    protected function getDefaults(): array
11
    {
12
        return [
13
            'user' => UserFactory::new(),
14
            'body' => self::faker()->sentence(),
15
            'created_at' => self::faker()->dateTime(),
16
            'post' => PostFactory::new(),
17
        ];
18
    }
19
20
    protected static function getClass(): string
21
    {
22
        return Comment::class;
23
    }
24
}
25