Location   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 33
ccs 0
cts 13
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLineNumber() 0 4 1
A getColumnNumber() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of phpDocumentor.
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 *
11
 * @link      http://phpdoc.org
12
 */
13
14
namespace phpDocumentor\Reflection;
15
16
/**
17
 * The location where an element occurs within a file.
18
 *
19
 * @psalm-immutable
20
 */
21
final class Location
22
{
23
    /** @var int */
24
    private $lineNumber = 0;
25
26
    /** @var int */
27
    private $columnNumber = 0;
28
29
    /**
30
     * Initializes the location for an element using its line number in the file and optionally the column number.
31
     */
32
    public function __construct(int $lineNumber, int $columnNumber = 0)
33
    {
34
        $this->lineNumber = $lineNumber;
35
        $this->columnNumber = $columnNumber;
36
    }
37
38
    /**
39
     * Returns the line number that is covered by this location.
40
     */
41
    public function getLineNumber() : int
42
    {
43
        return $this->lineNumber;
44
    }
45
46
    /**
47
     * Returns the column number (character position on a line) for this location object.
48
     */
49
    public function getColumnNumber() : int
50
    {
51
        return $this->columnNumber;
52
    }
53
}
54