PropertyOperationUnary   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 69.23%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 54
ccs 9
cts 13
cp 0.6923
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 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;
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