Passed
Pull Request — master (#1)
by Kevin
06:45
created

ServiceStory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

2 Methods

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