Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
Paginator
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 createForm
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 createRange
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <dev@noladev.com>
8 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Paginator;
16
17/**
18 * Paginator factory class
19 *
20 * @category   Pop
21 * @package    Pop\Paginator
22 * @author     Nick Sagona, III <dev@noladev.com>
23 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    4.1.0
26 */
27class Paginator
28{
29
30    /**
31     * Create paginator form object
32     *
33     * @param  int $total
34     * @param  int $perPage
35     * @return Form
36     */
37    public static function createForm(int $total, int $perPage = 10): Form
38    {
39        return new Form($total, $perPage);
40    }
41
42    /**
43     * Create paginator form object
44     *
45     * @param  int $total
46     * @param  int $perPage
47     * @param  int $range
48     * @return Range
49     */
50    public static function createRange(int $total, int $perPage = 10, int $range = 10): Range
51    {
52        return new Range($total, $perPage, $range);
53    }
54
55}