PostStory::build()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 20
rs 9.8333
cc 1
nc 1
nop 0
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
8
/**
9
 * @author Kevin Bond <[email protected]>
10
 */
11
final class PostStory extends Story
12
{
13
    public function build(): void
14
    {
15
        $this->addState('postA', PostFactory::new()->create([
16
            'title' => 'Post A',
17
            'category' => CategoryStory::php(),
0 ignored issues
show
Bug introduced by
The method php() does not exist on Zenstruck\Foundry\Tests\...s\Stories\CategoryStory. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
            'category' => CategoryStory::/** @scrutinizer ignore-call */ php(),
Loading history...
18
        ]));
19
20
        $this->addState('postB', PostFactory::new()->create([
21
            'title' => 'Post B',
22
            'category' => CategoryStory::php(),
23
        ])->object());
24
25
        $this->addState('postC', PostFactory::new([
26
            'title' => 'Post C',
27
            'category' => CategoryStory::symfony(),
0 ignored issues
show
Bug introduced by
The method symfony() does not exist on Zenstruck\Foundry\Tests\...s\Stories\CategoryStory. Since you implemented __callStatic, consider adding a @method annotation. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

27
            'category' => CategoryStory::/** @scrutinizer ignore-call */ symfony(),
Loading history...
28
        ]));
29
30
        PostFactory::new()->create([
31
            'title' => 'Post D',
32
            'category' => CategoryStory::php(),
33
        ]);
34
    }
35
}
36