Completed
Pull Request — master (#293)
by
unknown
02:49
created

CurrieResource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
crap 2
1
<?php
2
3
namespace League\Fractal\Hal;
4
5
use League\Fractal\Helper\Validator;
6
7
class CurrieResource
8
{
9
    private $key;
10
11
    private $href;
12
13
    public function __construct($key, $href)
14
    {
15
        Validator::validateParamString('key', $key);
16
        Validator::validateParamString('href', $href);
17
18
        $this->key = $key;
19
        $this->href = $href;
20
    }
21
22
    /**
23
     * @return string
24
     */
25
    public function getHref()
26
    {
27
        return $this->href;
28
    }
29
30
    /**
31
     * @return string
32
     */
33
    public function getKey()
34
    {
35
        return $this->key;
36
    }
37
}
38