Builder::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 2
b 0
f 1
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
namespace AnimeDb\Bundle\AppBundle\Util\Pagination;
10
11
class Builder
12
{
13
    /**
14
     * The number of pages displayed in the navigation.
15
     *
16
     * @var int
17
     */
18
    protected $max_navigate = Configuration::DEFAULT_LIST_LENGTH;
19
20
    /**
21
     * @param int $max_navigate
22
     */
23 2
    public function __construct($max_navigate)
24
    {
25 2
        $this->max_navigate = $max_navigate;
26 2
    }
27
28
    /**
29
     * @param int $total_pages
30
     * @param int $current_page
31
     *
32
     * @return Configuration
33
     */
34 2
    public function create($total_pages = 0, $current_page = 1)
35
    {
36 2
        return (new Configuration($total_pages, $current_page))
37 2
            ->setMaxNavigate($this->max_navigate);
38
    }
39
}
40