ServiceStory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 13
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
    /** @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