ApiCollection::getTotalPages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bone\BoneDoctrine\Collection;
6
7
use Bone\Contracts\Collection\ApiCollectionInterface;
8
use Doctrine\Common\Collections\ArrayCollection;
9
use Psr\Http\Message\UriInterface;
10
11
class ApiCollection extends ArrayCollection implements ApiCollectionInterface
12
{
13
    private int $page;
14
    private int $totalPages;
15
    private UriInterface $uri;
16
17
    public function __construct(array $elements, UriInterface $uri, int $page, int $totalPages, int  $totalRecords)
0 ignored issues
show
Unused Code introduced by
The parameter $totalRecords is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

17
    public function __construct(array $elements, UriInterface $uri, int $page, int $totalPages, /** @scrutinizer ignore-unused */ int  $totalRecords)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
18
    {
19
        parent::__construct($elements);
20
        $this->page = $page;
21
        $this->totalPages = $totalPages;
22
        $this->uri = $uri;
23
    }
24
25
    public function getTotalPages(): int
26
    {
27
        return $this->totalPages;
28
    }
29
30
    public function getUri(): UriInterface
31
    {
32
        return $this->uri;
33
    }
34
35
    public function getPage(): int
36
    {
37
        return $this->page;
38
    }
39
}
40