PaginationDecoratorAbstract   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 133
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 17.86%

Importance

Changes 0
Metric Value
wmc 12
lcom 1
cbo 1
dl 0
loc 133
ccs 5
cts 28
cp 0.1786
rs 10
c 0
b 0
f 0

12 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A isActive() 0 4 1
A isDefaultPageSize() 0 4 1
A getPageSize() 0 4 1
A setPageSize() 0 5 1
A getCurrent() 0 4 1
A setCurrent() 0 5 1
A getPrevious() 0 4 1
A getNext() 0 4 1
A getFirst() 0 4 1
A getLast() 0 4 1
A getPagesCount() 0 4 1
1
<?php
2
namespace Germania\Pagination;
3
4
abstract class PaginationDecoratorAbstract implements PaginationInterface
5
{
6
7
	/**
8
	 * @var PaginationInterface
9
	 */
10
	public $pagination;
11
12
13
14
	/**
15
	 * @param PaginationInterface $pagination 
16
	 */
17 48
	public function __construct( PaginationInterface $pagination )
18
	{
19 48
		$this->pagination = $pagination;
20 48
	}
21
22
23
	/**
24
	 * @inheritDoc
25
	 */
26
	public function isActive() : bool
27
	{
28
		return $this->pagination->isActive();
29
	}
30
31
32
33
	/**
34
	 * @inheritDoc
35
	 */
36 24
	public function isDefaultPageSize() : bool
37
	{
38 24
		return $this->pagination->isDefaultPageSize();
39
	}
40
41
42
43
	/**
44
	 * @inheritDoc
45
	 */
46
	public function getPageSize( $use_default = true )
47
	{
48
		return $this->pagination->getPageSize( $use_default);
0 ignored issues
show
Unused Code introduced by
The call to PaginationInterface::getPageSize() has too many arguments starting with $use_default.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
49
	}
50
51
52
	/**
53
	 * @inheritDoc
54
	 */
55
	public function setPageSize( $size )
56
	{
57
		$this->pagination->setPageSize( $size );
58
		return $this;
59
	}
60
61
62
63
64
65
	/**
66
	 * @inheritDoc
67
	 */
68
	public function getCurrent()
69
	{
70
		return $this->pagination->getCurrent();
71
	}
72
73
	/**
74
	 * @inheritDoc
75
	 */
76
	public function setCurrent( $number )
77
	{
78
		$this->pagination->setCurrent( $number );
79
		return $this;		
80
	}
81
82
83
84
85
86
	/**
87
	 * @inheritDoc
88
	 */
89
	public function getPrevious()
90
	{
91
		return $this->pagination->getPrevious();
92
	}
93
94
	/**
95
	 * @inheritDoc
96
	 */
97
	public function getNext()
98
	{
99
		return $this->pagination->getNext();
100
	}
101
102
103
104
105
	/**
106
	 * @inheritDoc
107
	 */
108
	public function getFirst() : int
109
	{
110
		return $this->pagination->getFirst();
111
	}
112
113
	/**
114
	 * @inheritDoc
115
	 */
116
	public function getLast() : int
117
	{
118
		return $this->pagination->getLast();
119
	}
120
121
	/**
122
	 * @inheritDoc
123
	 */
124
	public function getPagesCount() : int
125
	{
126
		$this->pagination->getPagesCount();
127
	}
128
129
130
131
132
133
134
135
136
}