Builder   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 1
Metric Value
wmc 2
lcom 1
cbo 1
dl 0
loc 29
ccs 6
cts 6
cp 1
rs 10
c 4
b 0
f 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A create() 0 5 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