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

Offset::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
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 Offset
16
 */
17 View Code Duplication
class Offset 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 $offset;
23
24
    /**
25
     * Offset constructor.
26
     * @param int $offset
27
     */
28 2
    public function __construct(int $offset)
29
    {
30 2
        $this->offset = $offset;
31 2
    }
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 2
    public function getOffset(): int
45
    {
46 2
        return $this->offset;
47
    }
48
}
49