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

ClassRemoved::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

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