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
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Paginator;
15
16/**
17 * Paginator factory class
18 *
19 * @category   Pop
20 * @package    Pop\Paginator
21 * @author     Nick Sagona, III <dev@nolainteractive.com>
22 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
23 * @license    http://www.popphp.org/license     New BSD License
24 * @version    4.0.0
25 */
26class Paginator
27{
28
29    /**
30     * Create paginator form object
31     *
32     * @param  int $total
33     * @param  int $perPage
34     * @return Form
35     */
36    public static function createForm(int $total, int $perPage = 10): Form
37    {
38        return new Form($total, $perPage);
39    }
40
41    /**
42     * Create paginator form object
43     *
44     * @param  int $total
45     * @param  int $perPage
46     * @param  int $range
47     * @return Range
48     */
49    public static function createRange(int $total, int $perPage = 10, int $range = 10): Range
50    {
51        return new Range($total, $perPage, $range);
52    }
53
54}