Completed
Push — master ( 1cdbe4...17a825 )
by T
02:03
created

TraitOperationDelta::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 4
crap 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 View Code Duplication
class TraitOperationDelta extends Operation
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
	/**
11
	 * @var string
12
	 */
13
	protected $fileBefore;
14
	/**
15
	 * @var \PhpParser\Node\Stmt\Trait_
16
	 */
17
	protected $traitBefore;
18
	/**
19
	 * @var string
20
	 */
21
	protected $fileAfter;
22
	/**
23
	 * @var \PhpParser\Node\Stmt\Trait_
24
	 */
25
	protected $traitAfter;
26
27 1
	public function __construct($fileBefore, Trait_ $traitBefore, $fileAfter, Trait_ $traitAfter)
28
	{
29 1
		$this->fileBefore = $fileBefore;
30 1
		$this->traitBefore = $traitBefore;
31 1
		$this->fileAfter = $fileAfter;
32 1
		$this->traitAfter = $traitAfter;
33 1
	}
34
35
	/**
36
	 * @return string
37
	 */
38
	public function getLocation()
39
	{
40
		return $this->fileAfter;
41
	}
42
43
	/**
44
	 * @return int
45
	 */
46
	public function getLine()
47
	{
48
		return $this->traitAfter->getLine();
49
	}
50
51
	/**
52
	 * @return string
53
	 */
54 1
	public function getTarget()
55
	{
56 1
		return PTrait::getFullyQualifiedName($this->traitAfter);
57
	}
58
}
59