Passed
Push — master ( 8af3ec...4c67f7 )
by Derek Stephen
01:43
created

ApiCollection   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getPage() 0 3 1
A __construct() 0 6 1
A getUri() 0 3 1
A getTotalPages() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bone\BoneDoctrine\Collection;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Psr\Http\Message\UriInterface;
9
10
class ApiCollection extends ArrayCollection
11
{
12
    private int $page;
13
    private int $totalPages;
14
    private UriInterface $uri;
15
16
    public function __construct(array $elements = [], UriInterface $uri, int $page, int $totalPages)
17
    {
18
        parent::__construct($elements);
19
        $this->page = $page;
20
        $this->totalPages = $totalPages;
21
        $this->uri = $uri;
22
    }
23
24
    public function getTotalPages(): int
25
    {
26
        return $this->totalPages;
27
    }
28
29
    public function getUri(): UriInterface
30
    {
31
        return $this->uri;
32
    }
33
34
    public function getPage(): int
35
    {
36
        return $this->page;
37
    }
38
}
39