Completed
Push — master ( 9e8686...7944fd )
by T
01:42
created

PropertyOperationUnary::getTarget()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace PHPSemVerChecker\Operation;
4
5
use PhpParser\Node\Stmt;
6
use PhpParser\Node\Stmt\Property;
7
use PHPSemVerChecker\Node\Statement\Property as PProperty;
8
9
class PropertyOperationUnary extends PropertyOperation {
10
	/**
11
	 * @var string
12
	 */
13
	protected $file;
14
	/**
15
	 * @var \PhpParser\Node\Stmt
16
	 */
17
	protected $propertyContext;
18
	/**
19
	 * @var \PhpParser\Node\Stmt\Property
20
	 */
21
	protected $property;
22
23
	/**
24
	 * @param string                        $context
25
	 * @param string                        $file
26
	 * @param \PhpParser\Node\Stmt          $propertyContex
0 ignored issues
show
Documentation introduced by
There is no parameter named $propertyContex. Did you maybe mean $propertyContext?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.

Consider the following example. The parameter $ireland is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $ireland
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was changed, but the annotation was not.

Loading history...
27
	 * @param \PhpParser\Node\Stmt\Property $property
28
	 */
29 4
	public function __construct($context, $file, Stmt $propertyContext, Property $property)
30
	{
31 4
		$this->context = $context;
32 4
		$this->visibility = $this->getVisibility($property);
33 4
		$this->file = $file;
34 4
		$this->propertyContext = $propertyContext;
35 4
		$this->property = $property;
36 4
	}
37
38
	/**
39
	 * @return string
40
	 */
41
	public function getLocation()
42
	{
43
		return $this->file;
44
	}
45
46
	/**
47
	 * @return int
48
	 */
49
	public function getLine()
50
	{
51
		return $this->property->getLine();
52
	}
53
54
	/**
55
	 * @return string
56
	 */
57 4
	public function getTarget()
58
	{
59 4
		return PProperty::getFullyQualifiedName($this->propertyContext, $this->property);
60
	}
61
}
62