Link::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace TomPHP\HalClient\Resource;
4
5
use TomPHP\HalClient\ResourceFetcher;
6
7
final class Link
8
{
9
    /** @var ResourceFetcher */
10
    private $fetcher;
11
12
    /** @var string */
13
    private $href;
14
15
    /**
16
     * @param string $href
17
     */
18
    public function __construct(ResourceFetcher $fetcher, $href)
19
    {
20
        $this->fetcher = $fetcher;
21
        $this->href    = $href;
22
    }
23
24
    /** @return Resource */
25
    public function get()
26
    {
27
        return $this->fetcher->get($this->href);
28
    }
29
}
30