Completed
Pull Request — master (#99)
by
unknown
01:44
created

InterfaceRenamedCaseOnly::getLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 4
loc 4
ccs 0
cts 2
cp 0
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt\Interface_;
6
use PHPSemVerChecker\Node\Statement\Interface_ as PInterface;
7
8 View Code Duplication
class InterfaceRenamedCaseOnly 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
	 * @var string
11
	 */
12
	protected $code = 'V153';
13
	/**
14
	 * @var string
15
	 */
16
	protected $reason = 'Interface was renamed (case only).';
17
	/**
18
	 * @var string
19
	 */
20
	protected $fileAfter;
21
	/**
22
	 * @var \PhpParser\Node\Stmt\Interface_
23
	 */
24
	protected $interfaceAfter;
25
26
	/**
27
	 * @param string                          $fileAfter
28
	 * @param \PhpParser\Node\Stmt\Interface_ $interfaceAfter
29
	 */
30 1
	public function __construct($fileAfter, Interface_ $interfaceAfter)
31
	{
32 1
		$this->fileAfter = $fileAfter;
33 1
		$this->interfaceAfter = $interfaceAfter;
34 1
	}
35
36
	/**
37
	 * @return string
38
	 */
39
	public function getLocation()
40
	{
41
		return $this->fileAfter;
42
	}
43
44
	/**
45
	 * @return int
46
	 */
47
	public function getLine()
48
	{
49
		return $this->interfaceAfter->getLine();
50
	}
51
52
	/**
53
	 * @return string
54
	 */
55
	public function getTarget()
56
	{
57
		return PInterface::getFullyQualifiedName($this->interfaceAfter);
58
	}
59
}
60