Link::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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