Link   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 10
c 1
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A __toString() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Koriym\AppStateDiagram;
6
7
final class Link
8
{
9
    /** @var string */
10
    public $from;
11
12
    /** @var string */
13
    public $to;
14
15
    /** @var string */
16
    public $label;
17
18
    /** @var TransDescriptor */
19
    public $transDescriptor;
20
21
    public function __construct(SemanticDescriptor $semantic, TransDescriptor $trans, LabelNameInterface $labelName)
22
    {
23
        $this->from = $semantic->id;
24
        $this->to = $trans->rt;
25
        $this->label = $labelName->getLinkLabel($trans);
26
        $this->transDescriptor = $trans;
27
    }
28
29
    public function __toString(): string
30
    {
31
        return $this->label;
32
    }
33
}
34