StreamContents::items()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
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 9
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 StreamContents extends AbstractObject implements ObjectInterface
8
{
9
10 3
    public function direction(): string
11
    {
12 3
        return $this->data->direction;
13
    }
14
15 3
    public function id(): string
16
    {
17 3
        return $this->data->id;
18
    }
19
20 3
    public function title(): string
21
    {
22 3
        return $this->data->title;
23
    }
24
25
    public function description(): string
26
    {
27
        return $this->data->description;
28
    }
29
30 3
    public function self(): ItemSelf
31
    {
32 3
        return new ItemSelf($this->data->self);
33
    }
34
35 3
    public function updated(): int
36
    {
37 3
        return $this->data->updated;
38
    }
39
40 3
    public function updatedUsec(): string
41
    {
42 3
        return $this->data->updatedUsec;
43
    }
44
45 3
    public function continuation(): ?string
46
    {
47 3
        return $this->data->continuation ?? null;
48
    }
49
50
    /**
51
     * @return Item[]
52
     */
53 3
    public function items(): array
54
    {
55
56 3
        $items = [];
57 3
        foreach ($this->data->items as $item) {
58 3
            $items[] = new Item($item);
59
        }
60
61 3
        return $items;
62
    }
63
}
64