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

FunctionOperationUnary::getLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt\Function_;
6
use PHPSemVerChecker\Node\Statement\Function_ as PFunction;
7
8
abstract class FunctionOperationUnary extends Operation
9
{
10
	/**
11
	 * @var string
12
	 */
13
	protected $file;
14
	/**
15
	 * @var \PhpParser\Node\Stmt\Function_
16
	 */
17
	protected $function;
18
19
	/**
20
	 * @param string                         $file
21
	 * @param \PhpParser\Node\Stmt\Function_ $function
22
	 */
23 9
	public function __construct($file, Function_ $function)
24
	{
25 9
		$this->file = $file;
26 9
		$this->function = $function;
27 9
	}
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->function->getLine();
43
	}
44
45
	/**
46
	 * @return string
47
	 */
48 9
	public function getTarget()
49
	{
50 9
		return PFunction::getFullyQualifiedName($this->function);
51
	}
52
}
53