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

TraitRemoved::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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