Links   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 21
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A provide() 0 3 1
A none() 0 3 1
A current() 0 3 1
A __construct() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\RestResource;
4
5
use Stratadox\ImmutableCollection\ImmutableCollection;
6
7
final class Links extends ImmutableCollection
8
{
9
    private function __construct(Link ...$links)
10
    {
11
        parent::__construct(...$links);
12
    }
13
14
    public static function none(): Links
15
    {
16
        return new self();
17
    }
18
19
    public static function provide(Link ...$links): Links
20
    {
21
        return new self(...$links);
22
    }
23
24
    /** @codeCoverageIgnore used for type safety and IDE auto completion */
25
    public function current(): Link
26
    {
27
        return parent::current();
28
    }
29
}
30