ListItems::getTotalPages()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the Tmdb package.
4
 *
5
 * (c) Vincent Faliès <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 *
10
 * @author Vincent Faliès <[email protected]>
11
 * @copyright Copyright (c) 2017
12
 */
13
14
namespace VfacTmdb\Traits;
15
16
/**
17
 * listItems trait
18
 * @package Tmdb
19
 * @author Vincent Faliès <[email protected]>
20
 * @copyright Copyright (c) 2017
21
 */
22
trait ListItems
23
{
24
    /**
25
     * Page number
26
     * @var int
27
     */
28
    public $page = 1;
29
    /**
30
     * Total pages
31
     * @var int
32
     */
33
    public $total_pages = 1;
34
    /**
35
     * Total results
36
     * @var int
37
     */
38
    public $total_results = 0;
39
40
    /**
41
     * Get page from result search
42
     * @return int
43
     */
44 6
    public function getPage() : int
45
    {
46 6
        return $this->page;
47
    }
48
49
    /**
50
     * Get total page from result search
51
     * @return int
52
     */
53 6
    public function getTotalPages() : int
54
    {
55 6
        return $this->total_pages;
56
    }
57
58
    /**
59
     * Get total results from search
60
     * @return int
61
     */
62 6
    public function getTotalResults() : int
63
    {
64 6
        return $this->total_results;
65
    }
66
}
67