Entry   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 7
Bugs 0 Features 3
Metric Value
wmc 4
c 7
b 0
f 3
lcom 1
cbo 2
dl 0
loc 40
ccs 10
cts 10
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getEventUrl() 0 6 1
A getTitle() 0 4 1
A getLinks() 0 4 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