Operation::getTarget()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PHPSemVerChecker\Configuration\LevelMapping;
6
7
abstract class Operation
8
{
9
	/**
10
	 * @var string
11
	 */
12
	protected $code;
13
	/**
14
	 * @var string
15
	 */
16
	protected $reason;
17
	/**
18
	 * @var string
19
	 */
20
	protected $target;
21
22
	/**
23
	 * @return string
24
	 */
25 25
	public function getCode()
26
	{
27 25
		return $this->code;
28
	}
29
30
	/**
31
	 * @param string $code
32
	 * @return $this
33
	 */
34
	public function setCode($code)
35
	{
36
		$this->code = $code;
37
38
		return $this;
39
	}
40
41
	/**
42
	 * @return int
43
	 */
44 111
	public function getLevel()
45
	{
46 111
		return LevelMapping::getLevelForCode($this->getCode());
47
	}
48
49
	/**
50
	 * @return string
51
	 */
52 22
	public function getReason()
53
	{
54 22
		return $this->reason;
55
	}
56
57
	/**
58
	 * @param string $reason
59
	 * @return $this
60
	 */
61
	public function setReason($reason)
62
	{
63
		$this->reason = $reason;
64
65
		return $this;
66
	}
67
68
	/**
69
	 * @return string
70
	 */
71
	public abstract function getLocation();
72
73
	/**
74
	 * @return int
75
	 */
76
	public abstract function getLine();
77
78
	/**
79
	 * @return string
80
	 */
81
	public function getTarget()
82
	{
83
		return $this->target;
84
	}
85
86
	/**
87
	 * @param string $target
88
	 * @return $this
89
	 */
90
	public function setTarget($target)
91
	{
92
		$this->target = $target;
93
94
		return $this;
95
	}
96
}
97