Completed
Push — master ( 0e1c32...e580ff )
by T
05:02
created

FunctionOperationDelta::getLine()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt\Function_;
6
use PHPSemVerChecker\Node\Statement\Function_ as PFunction;
7
8
abstract class FunctionOperationDelta extends Operation
9
{
10
	/**
11
	 * @var string
12
	 */
13
	protected $fileBefore;
14
	/**
15
	 * @var \PhpParser\Node\Stmt\Function_
16
	 */
17
	protected $functionBefore;
18
	/**
19
	 * @var string
20
	 */
21
	protected $fileAfter;
22
	/**
23
	 * @var \PhpParser\Node\Stmt\Function_
24
	 */
25
	protected $functionAfter;
26
27
	/**
28
	 * @param string                         $fileBefore
29
	 * @param \PhpParser\Node\Stmt\Function_ $functionBefore
30
	 * @param string                         $fileAfter
31
	 * @param \PhpParser\Node\Stmt\Function_ $functionAfter
32
	 */
33 4
	public function __construct($fileBefore, Function_ $functionBefore, $fileAfter, Function_ $functionAfter)
34
	{
35 4
		$this->fileBefore = $fileBefore;
36 4
		$this->functionBefore = $functionBefore;
37 4
		$this->fileAfter = $fileAfter;
38 4
		$this->functionAfter = $functionAfter;
39 4
	}
40
41
	/**
42
	 * @return string
43
	 */
44
	public function getLocation()
45
	{
46
		return $this->fileBefore;
47
	}
48
49
	/**
50
	 * @return int
51
	 */
52
	public function getLine()
53
	{
54
		return $this->functionAfter->getLine();
55
	}
56
57
	/**
58
	 * @return string
59
	 */
60 3
	public function getTarget()
61
	{
62 3
		return PFunction::getFullyQualifiedName($this->functionAfter);
63
	}
64
}
65