Completed
Push — master ( 39caf5...4ceab2 )
by Sam
02:39
created

LimitTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A filterByLimit() 0 7 2
limit() 0 1 ?
1
<?php
2
3
namespace Jalle19\StatusManager\Database;
4
5
/**
6
 * Class LimitTrait
7
 * @package   Jalle19\StatusManager\Database
8
 * @copyright Copyright &copy; Sam Stenvall 2016-
9
 * @license   https://www.gnu.org/licenses/gpl.html The GNU General Public License v2.0
10
 */
11
trait LimitTrait
12
{
13
14
	/**
15
	 * @param int|null $limit
16
	 *
17
	 * @return mixed
18
	 */
19 1
	public function filterByLimit($limit)
20
	{
21 1
		if ($limit !== null)
22 1
			$this->limit($limit);
23
24 1
		return $this;
25
	}
26
27
28
	public abstract function limit($limit);
29
30
}
31