ApiCollection   A
last analyzed

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 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