Links   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A add() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Koriym\AppStateDiagram;
6
7
use function sprintf;
8
9
class Links
10
{
11
    /**
12
     * @var array<string, Link>
13
     * @psalm-readonly
14
     */
15
    public $links = [];
16
17
    public function add(Link $link): void
18
    {
19
        $edgeId = sprintf('%s->%s:%s', $link->from, $link->to, $link->transDescriptor->id);
20
21
        /** @psalm-suppress InaccessibleProperty */
22
        $this->links[$edgeId] = $link;
23
    }
24
}
25