InterfaceOperationUnary::getLocation()   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 PhpParser\Node\Stmt\Interface_;
6
use PHPSemVerChecker\Node\Statement\Interface_ as PInterface;
7
8
class InterfaceOperationUnary extends Operation
9
{
10
	/**
11
	 * @var string
12
	 */
13
	protected $file;
14
	/**
15
	 * @var \PhpParser\Node\Stmt\Interface_
16
	 */
17
	protected $interface;
18
19
	/**
20
	 * @param string                          $fileAfter
21
	 * @param \PhpParser\Node\Stmt\Interface_ $interface
22
	 */
23 3
	public function __construct($fileAfter, Interface_ $interface)
24
	{
25 3
		$this->file = $fileAfter;
26 3
		$this->interface = $interface;
27 3
	}
28
29
	/**
30
	 * @return string
31
	 */
32
	public function getLocation()
33
	{
34
		return $this->file;
35
	}
36
37
	/**
38
	 * @return int
39
	 */
40
	public function getLine()
41
	{
42
		return $this->interface->getLine();
43
	}
44
45
	/**
46
	 * @return string
47
	 */
48 2
	public function getTarget()
49
	{
50 2
		return PInterface::getFullyQualifiedName($this->interface);
51
	}
52
}
53