Passed
Push — master ( 01151b...3d8b44 )
by Kevin
04:44
created

ResultPaginator::paginate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace Zenstruck\Porpaginas;
4
5
/**
6
 * @author Kevin Bond <[email protected]>
7
 */
8
trait ResultPaginator
9
{
10 7
    public function paginate(int $page = 1, int $limit = Pager::DEFAULT_LIMIT): Pager
11
    {
12 7
        return new Pager($this, $page, $limit);
0 ignored issues
show
Bug introduced by
$this of type Zenstruck\Porpaginas\ResultPaginator is incompatible with the type Zenstruck\Porpaginas\Result expected by parameter $result of Zenstruck\Porpaginas\Pager::__construct(). ( Ignorable by Annotation )

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

12
        return new Pager(/** @scrutinizer ignore-type */ $this, $page, $limit);
Loading history...
13
    }
14
}
15