1 | <?php |
||
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 |
||
|
|||
27 | * @param \PhpParser\Node\Stmt\Property $property |
||
28 | */ |
||
29 | 4 | public function __construct($context, $file, Stmt $propertyContext, Property $property) |
|
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getLocation() |
||
45 | |||
46 | /** |
||
47 | * @return int |
||
48 | */ |
||
49 | public function getLine() |
||
53 | |||
54 | /** |
||
55 | * @return string |
||
56 | */ |
||
57 | 4 | public function getTarget() |
|
61 | } |
||
62 |
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 methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.