TraitOperationUnary   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 45
ccs 6
cts 10
cp 0.6
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLocation() 0 4 1
A getLine() 0 4 1
A getTarget() 0 4 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 TraitOperationUnary extends Operation
9
{
10
	/**
11
	 * @var string
12
	 */
13
	protected $file;
14
	/**
15
	 * @var \PhpParser\Node\Stmt\Trait_
16
	 */
17
	protected $trait;
18
19
	/**
20
	 * @param string                      $file
21
	 * @param \PhpParser\Node\Stmt\Trait_ $trait
22
	 */
23 3
	public function __construct($file, Trait_ $trait)
24
	{
25 3
		$this->file = $file;
26 3
		$this->trait = $trait;
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->trait->getLine();
43
	}
44
45
	/**
46
	 * @return string
47
	 */
48 2
	public function getTarget()
49
	{
50 2
		return PTrait::getFullyQualifiedName($this->trait);
51
	}
52
}
53