Subscription::categories()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 8
ccs 5
cts 5
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ExileeD\Inoreader\Objects;
6
7
class Subscription extends AbstractObject implements ObjectInterface
8
{
9
10 3
    public function id(): string
11
    {
12 3
        return $this->data->id;
13
    }
14
15 3
    public function title(): string
16
    {
17 3
        return $this->data->title;
18
    }
19
20 3
    public function feedType(): string
21
    {
22 3
        return $this->data->feedType;
23
    }
24
25
    /**
26
     * @return Category[]
27
     */
28 3
    public function categories(): array
29
    {
30 3
        $items = [];
31 3
        foreach ($this->data->categories as $category) {
32 3
            $items[] = new Category($category);
33
        }
34
35 3
        return $items;
36
    }
37
38 3
    public function sortId(): string
39
    {
40 3
        return $this->data->sortid;
41
    }
42
43 3
    public function firstItemMsec(): int
44
    {
45 3
        return $this->data->firstitemmsec;
46
    }
47
48 3
    public function url(): string
49
    {
50 3
        return $this->data->url;
51
    }
52
53 3
    public function htmlUrl(): string
54
    {
55 3
        return $this->data->htmlUrl;
56
    }
57
58
    public function iconUrl(): string
59
    {
60
        return $this->data->iconUrl;
61
    }
62
}
63