Completed
Push — master ( 9e4cdb...1641ea )
by Alexandr
02:44
created

Location::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Date: 16.11.16
4
 *
5
 * @author Portey Vasil <[email protected]>
6
 */
7
8
namespace Youshido\GraphQL\Parser;
9
10
11
class Location
12
{
13
14
    /** @var  integer */
15
    private $line;
16
17
    /** @var  integer */
18
    private $column;
19
20 87
    public function __construct($line, $column)
21
    {
22 87
        $this->line   = $line;
23 87
        $this->column = $column;
24 87
    }
25
26
    /**
27
     * @return int
28
     */
29 9
    public function getLine()
30
    {
31 9
        return $this->line;
32
    }
33
34
    /**
35
     * @return int
36
     */
37 9
    public function getColumn()
38
    {
39 9
        return $this->column;
40
    }
41
42
43 9
    public function toArray()
44
    {
45
        return [
46 9
            'line'   => $this->getLine(),
47 9
            'column' => $this->getColumn()
48 9
        ];
49
    }
50
51
}