Tunnel   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A method() 0 3 1
A __construct() 0 4 1
A __toString() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Compose\Compilation\Service\Argument;
5
6
use Innmind\Compose\{
7
    Compilation\Service\Argument,
8
    Compilation\MethodName,
9
    Definition\Name,
10
    Exception\LogicException
11
};
12
13
final class Tunnel implements Argument
14
{
15
    private $dependency;
16
    private $method;
17
18 8
    public function __construct(Name $dependency, MethodName $method)
19
    {
20 8
        $this->dependency = $dependency;
21 8
        $this->method = $method;
22 8
    }
23
24 1
    public function method(): MethodName
25
    {
26 1
        throw new LogicException('Tunnel cannot be accessed from outside the compiled container');
27
    }
28
29 5
    public function __toString(): string
30
    {
31 5
        return sprintf('$this->%s->%s()', $this->dependency, $this->method);
32
    }
33
}
34