Completed
Push — master ( cbfed7...c39fb6 )
by Rafael
05:06
created

OrderBy::setDirection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/*******************************************************************************
3
 *  This file is part of the GraphQL Bundle package.
4
 *
5
 *  (c) YnloUltratech <[email protected]>
6
 *
7
 *  For the full copyright and license information, please view the LICENSE
8
 *  file that was distributed with this source code.
9
 ******************************************************************************/
10
11
namespace Ynlo\GraphQLBundle\Model;
12
13
use Ynlo\GraphQLBundle\Annotation as GraphQL;
14
15
/**
16
 * @GraphQL\InputObjectType()
17
 */
18
class OrderBy
19
{
20
    /**
21
     * @var string
22
     *
23
     * @GraphQL\Field(type="string!")
24
     */
25
    protected $field;
26
27
    /**
28
     * @var string
29
     *
30
     * @GraphQL\Field(type="string")
31
     */
32
    protected $direction = 'ASC';
33
34
    /**
35
     * @return string
36
     */
37 1
    public function getField(): string
38
    {
39 1
        return $this->field;
40
    }
41
42
    /**
43
     * @param string $field
44
     *
45
     * @return OrderBy
46
     */
47 1
    public function setField(string $field): OrderBy
48
    {
49 1
        $this->field = $field;
50
51 1
        return $this;
52
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getDirection(): string
58
    {
59 1
        return $this->direction;
60
    }
61
62
    /**
63
     * @param string $direction
64
     *
65
     * @return OrderBy
66
     */
67 1
    public function setDirection(string $direction): OrderBy
68
    {
69 1
        $this->direction = $direction;
70
71 1
        return $this;
72
    }
73
}
74