HydraPaginatedCollection   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 32
ccs 4
cts 4
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getFirstPage() 0 3 1
A getTotalItems() 0 3 1
A getLastPage() 0 3 1
A getNextPage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Mapado\RestClientSdk\Collection;
6
7
/**
8
 * Class HydraPaginatedCollection
9
 *
10
 * @author Florent Clerc <[email protected]>
11
 */
12
class HydraPaginatedCollection extends Collection
13
{
14
    /**
15
     * Returns first page URI.
16
     */
17
    public function getFirstPage(): ?string
18
    {
19 1
        return $this->getExtraProperty('hydra:firstPage');
20
    }
21
22
    /**
23
     * Returns last page URI.
24
     */
25
    public function getLastPage(): ?string
26
    {
27 1
        return $this->getExtraProperty('hydra:lastPage');
28
    }
29
30
    /**
31
     * Returns next page URI.
32
     */
33
    public function getNextPage(): ?string
34
    {
35 1
        return $this->getExtraProperty('hydra:nextPage');
36
    }
37
38
    /**
39
     * Returns total item count.
40
     */
41
    public function getTotalItems(): int
42
    {
43 1
        return $this->getExtraProperty('hydra:totalItems') ?? 0;
44
    }
45
}
46