Roads::available()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\Pathfinder\Graph;
4
5
use Stratadox\ImmutableCollection\Appending;
6
use Stratadox\ImmutableCollection\ImmutableCollection;
7
use Stratadox\ImmutableCollection\Merging;
8
9
final class Roads extends ImmutableCollection implements Edges
10
{
11
    use Appending, Merging;
12
13
    protected function __construct(Edge ...$roads)
14
    {
15
        parent::__construct(...$roads);
16
    }
17
18
    public static function available(Edge ...$roads): Edges
19
    {
20
        return new self(...$roads);
21
    }
22
23
    public static function none(): Edges
24
    {
25
        return new self();
26
    }
27
28
    public function current(): Edge
29
    {
30
        return parent::current();
31
    }
32
}
33