ReplacerAwareExtensionTrait   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 withReplacer() 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\Definitions\Replacer\ReplacerInterface;
9
10
/**
11
 * A helper trait to be used with ReplacerAwareExtension.
12
 */
13
trait ReplacerAwareExtensionTrait
14
{
15
    protected ReplacerInterface $replacer;
16
17 55
    public function withReplacer(ReplacerInterface $replacer): ExtensionInterface
18
    {
19 55
        $instance = clone $this;
20
21 55
        $instance->replacer = $replacer;
22
23 55
        return $instance;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $instance returns the type DummyGenerator\Definitio...acerAwareExtensionTrait which is incompatible with the type-hinted return DummyGenerator\Definitio...sion\ExtensionInterface.
Loading history...
24
    }
25
}
26