Entry::getLinks()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace EventStore\StreamFeed;
3
4
/**
5
 * Class Entry
6
 * @package EventStore\StreamFeed
7
 */
8
final class Entry
9
{
10
    use HasLinks;
11
12
    /**
13
     * @var array
14
     */
15
    private $json;
16
17
    /**
18
     * @param array $json
19
     */
20 11
    public function __construct(array $json)
21
    {
22 11
        $this->json = $json;
23 11
    }
24
25
    /**
26
     * @return null|string
27
     */
28 10
    public function getEventUrl()
29
    {
30 10
        $alternate = $this->getLinkUrl(LinkRelation::ALTERNATE());
31
32 10
        return $alternate;
33
    }
34
35 5
    public function getTitle()
36
    {
37 5
        return $this->json['title'];
38
    }
39
40
    /**
41
     * @return array
42
     */
43 10
    protected function getLinks()
44
    {
45 10
        return $this->json['links'];
46
    }
47
}
48