GeneratorAwareExtensionTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 11
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A withGenerator() 0 7 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace DummyGenerator\Definitions\Extension\Awareness;
6
7
use DummyGenerator\Definitions\Extension\ExtensionInterface;
8
use DummyGenerator\DummyGenerator;
9
10
/**
11
 * A helper trait to be used with GeneratorAwareExtension.
12
 */
13
trait GeneratorAwareExtensionTrait
14
{
15
    protected DummyGenerator $generator;
16
17 57
    public function withGenerator(DummyGenerator $generator): ExtensionInterface
18
    {
19 57
        $instance = clone $this;
20
21 57
        $instance->generator = $generator;
22
23 57
        return $instance;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $instance returns the type DummyGenerator\Definitio...atorAwareExtensionTrait which is incompatible with the type-hinted return DummyGenerator\Definitio...sion\ExtensionInterface.
Loading history...
24
    }
25
}
26