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

LimitTrait::filterByLimit()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 2
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