Completed
Push — 2.0 ( a5342d...dc219a )
by Kirill
04:04
created

Paginator::paginate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 */
7
declare(strict_types=1);
8
9
namespace App\GraphQL\Kernel;
10
11
use App\GraphQL\Kernel\Paginator\PaginatorConfiguration;
12
use App\GraphQL\Serializers\AbstractSerializer;
13
use Illuminate\Support\Collection;
14
use App\GraphQL\Serializers\RawSerializer;
15
use Illuminate\Database\Eloquent\Builder;
16
17
/**
18
 * Class Paginator
19
 * @package App\GraphQL\Serializers\Support
20
 */
21
trait Paginator
22
{
23
    /**
24
     * @param Builder $builder
25
     * @param int $count
26
     * @return PaginatorConfiguration
27
     */
28
    protected function paginate(Builder $builder, int $count): PaginatorConfiguration
29
    {
30
        return new PaginatorConfiguration($builder, $count);
31
    }
32
}