Passed
Pull Request — main (#1)
by Mojtaba
01:59
created

DefaultPaginatorResponse::getResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 11
rs 10
1
<?php
2
3
namespace Bugloos\ResponderBundle\Service;
4
5
use Bugloos\ResponderBundle\PaginatorHandler\Contract\PaginatorHandlerInterface;
6
class DefaultPaginatorResponse implements PaginationResponseInterface
0 ignored issues
show
Bug introduced by
The type Bugloos\ResponderBundle\...nationResponseInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
{
8
    public function getResult(PaginatorHandlerInterface $paginatorHandler, Paginator $paginator): array
9
    {
10
        return [
11
            'pagination' => [
12
                'totalPages' => $paginatorHandler->totalPages(),
13
                'totalItems' => $paginatorHandler->totalItems(),
14
                'count' => $paginator->count(),
15
                'itemsPerPage' => $paginatorHandler->numberOfItemsPerPage(),
16
                'page' => $paginator->getRequestedPageNumber(),
17
            ],
18
            'data' => $paginator->collection(),
19
        ];
20
    }
21
}
22