Passed
Branch develop (e0de4e)
by Baptiste
01:53
created

Middle   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __invoke() 0 5 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Fixture\Innmind\Compose\Stack;
5
6
use Fixture\Innmind\Compose\Stack;
7
8
final class Middle implements Stack
9
{
10
    private $stack;
11
12 2
    public function __construct(Stack $stack)
13
    {
14 2
        $this->stack = $stack;
15 2
    }
16
17 2
    public function __invoke(): string
18
    {
19 2
        return sprintf(
20 2
            'middle|%s|middle',
21 2
            ($this->stack)()
22
        );
23
    }
24
}
25