Passed
Push — master ( cc4042...33fa03 )
by Milroy
11:03
created

SortField::getDirection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ApiChef\RequestQueryHelper;
6
7
class SortField
8
{
9
    const DIRECTION_ASCENDING = 'asc';
10
    const DIRECTION_DESCENDING = 'desc';
11
12
    /** @var string */
13
    private $field;
14
15
    /** @var string */
16
    private $direction;
17
18 6
    /** @var string|null */
19
    private $params;
20 6
21 6
    public function __construct(string $field, string $direction, string $params = null)
22 6
    {
23
        $this->field = $field;
24 3
        $this->direction = $direction;
25
        $this->params = $params;
26 3
    }
27
28
    public function getField(): string
29 3
    {
30
        return $this->field;
31 3
    }
32
33
    public function getDirection(): string
34
    {
35
        return $this->direction;
36
    }
37
38
    public function getParams(): ?string
39
    {
40
        return $this->params;
41
    }
42
}
43