Passed
Push — master ( ddb2f3...fd433b )
by Kevin
03:42
created

CategoryServiceFactory::getClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
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\Category;
7
use Zenstruck\Foundry\Tests\Fixtures\Service;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
final class CategoryServiceFactory extends ModelFactory
13
{
14
    private $service;
15
16
    public function __construct(Service $service)
17
    {
18
        parent::__construct();
19
20
        $this->service = $service;
21
    }
22
23
    protected static function getClass(): string
24
    {
25
        return Category::class;
26
    }
27
28
    protected function getDefaults(): array
29
    {
30
        return ['name' => $this->service->name];
31
    }
32
}
33