ServiceStory::build()   A
last analyzed

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 0
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
    /** @var Service */
15
    private $service;
16
17
    public function __construct(Service $service)
18
    {
19
        $this->service = $service;
20
    }
21
22
    public function build(): void
23
    {
24
        $this->addState('post', PostFactory::new()->create(['title' => $this->service->name]));
25
    }
26
}
27