Closed
Description
version: at least 3.4.2 up to current master
In the following snippet, warning is triggered
class X
{
/**
* @api
*/
public function x()
{
}
private function y($x)
{
if ($x === null) { //warning reported here
}
}
}
Reason for this is that method y() has parameter but does not have doc comment and the method above (the method x()) has a doc comment with @api
annotation.
This causes the sniff to believe that the method y() is an api method, although actualy x() is.
You can see in the sniff it just searches for the previous doc comment, which does not necesarily belong to the method in question:
Putting even an empty doc comment above the methody y() makes the warning go away.
Metadata
Metadata
Assignees
Labels
No labels