Completed
Push — master ( 69b436...e84470 )
by Kirill
14:54 queued 05:27
created

Limit::getLimit()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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
14
/**
15
 * Class Limit
16
 */
17 View Code Duplication
class Limit extends Criterion
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * @var int
21
     */
22
    private $limit;
23
24
    /**
25
     * Limit constructor.
26
     * @param int $limit
27
     */
28 4
    public function __construct(int $limit)
29
    {
30 4
        $this->limit = $limit;
31 4
    }
32
33
    /**
34
     * @return Field
35
     */
36
    public function getField(): Field
37
    {
38
        throw new \LogicException(\sprintf('Criterion %s does not provide the field', \class_basename($this)));
39
    }
40
41
    /**
42
     * @return int
43
     */
44 4
    public function getLimit(): int
45
    {
46 4
        return $this->limit;
47
    }
48
}
49