CommentFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 7
c 1
b 0
f 1
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getClass() 0 3 1
A getDefaults() 0 7 1
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