Issues (8)

src/Collection/ApiCollection.php (1 issue)

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