Cancelled
Pull Request — master (#1)
by Kevin
09:12 queued 01:58
created

ServiceStory::__construct()   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
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Zenstruck\Foundry\Tests\Fixtures\Stories;
4
5
use Zenstruck\Foundry\Story;
6
use Zenstruck\Foundry\Tests\Fixtures\Factories\PostFactory;
7
use Zenstruck\Foundry\Tests\Fixtures\Service;
8
9
/**
10
 * @author Kevin Bond <[email protected]>
11
 */
12
final class ServiceStory extends Story
13
{
14
    private Service $service;
15
16
    public function __construct(Service $service)
17
    {
18
        $this->service = $service;
19
    }
20
21
    public function build(): void
22
    {
23
        $this->add('post', PostFactory::new()->create(['title' => $this->service->name]));
24
    }
25
}
26