Limit   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLimit() 0 4 1
1
<?php
2
/**
3
 * This file is part of Hydrogen package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types=1);
9
10
namespace RDS\Hydrogen\Criteria;
11
12
use RDS\Hydrogen\Criteria\Common\Field;
13
use RDS\Hydrogen\Query;
14
15
/**
16
 * Class Limit
17
 */
18
class Limit extends Criterion
19
{
20
    /**
21
     * @var int
22
     */
23
    private $limit;
24
25
    /**
26
     * Limit constructor.
27
     * @param Query $query
28
     * @param int $limit
29
     */
30 4
    public function __construct(Query $query, int $limit)
31
    {
32 4
        parent::__construct($query);
33
34 4
        $this->limit = $limit;
35 4
    }
36
37
    /**
38
     * @return int
39
     */
40 4
    public function getLimit(): int
41
    {
42 4
        return $this->limit;
43
    }
44
}
45