PropertyOperationUnary::getLine()   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;
6
use PhpParser\Node\Stmt\Property;
7
use PHPSemVerChecker\Node\Statement\Property as PProperty;
8
9
class PropertyOperationUnary extends PropertyOperation
10
{
11
	/**
12
	 * @var string
13
	 */
14
	protected $file;
15
	/**
16
	 * @var \PhpParser\Node\Stmt
17
	 */
18
	protected $propertyContext;
19
	/**
20
	 * @var \PhpParser\Node\Stmt\Property
21
	 */
22
	protected $property;
23
24
	/**
25
	 * @param string                        $context
26
	 * @param string                        $file
27
	 * @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...
28
	 * @param \PhpParser\Node\Stmt\Property $property
29
	 */
30 4
	public function __construct($context, $file, Stmt $propertyContext, Property $property)
31
	{
32 4
		$this->context = $context;
33 4
		$this->visibility = $this->getVisibility($property);
34 4
		$this->file = $file;
35 4
		$this->propertyContext = $propertyContext;
36 4
		$this->property = $property;
37 4
	}
38
39
	/**
40
	 * @return string
41
	 */
42
	public function getLocation()
43
	{
44
		return $this->file;
45
	}
46
47
	/**
48
	 * @return int
49
	 */
50
	public function getLine()
51
	{
52
		return $this->property->getLine();
53
	}
54
55
	/**
56
	 * @return string
57
	 */
58 4
	public function getTarget()
59
	{
60 4
		return PProperty::getFullyQualifiedName($this->propertyContext, $this->property);
61
	}
62
}
63