FunctionOperationDelta::getTarget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt\Function_;
6
use PHPSemVerChecker\Node\Statement\Function_ as PFunction;
7
8 View Code Duplication
abstract class FunctionOperationDelta extends Operation
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
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 5
	public function __construct($fileBefore, Function_ $functionBefore, $fileAfter, Function_ $functionAfter)
34
	{
35 5
		$this->fileBefore = $fileBefore;
36 5
		$this->functionBefore = $functionBefore;
37 5
		$this->fileAfter = $fileAfter;
38 5
		$this->functionAfter = $functionAfter;
39 5
	}
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 4
	public function getTarget()
61
	{
62 4
		return PFunction::getFullyQualifiedName($this->functionAfter);
63
	}
64
}
65