EdgeKey   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 17
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A __construct() 0 3 1
A from() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This source file is subject to the license that is bundled with this package in the file LICENSE.
4
 */
5
6
namespace PhUml\Graphviz\Builders;
7
8
use PhUml\Code\Name;
9
use PhUml\Code\Variables\TypeDeclaration;
10
use Stringable;
11
12
final class EdgeKey implements Stringable
13
{
14
    private readonly string $key;
15
16 13
    public static function from(Name $name, TypeDeclaration $type): EdgeKey
17
    {
18 13
        return new EdgeKey($name . $type);
19
    }
20
21 13
    private function __construct(string $key)
22
    {
23 13
        $this->key = $key;
0 ignored issues
show
Bug introduced by
The property key is declared read-only in PhUml\Graphviz\Builders\EdgeKey.
Loading history...
24
    }
25
26 13
    public function __toString(): string
27
    {
28 13
        return $this->key;
29
    }
30
}
31