1 | <?php |
||
13 | class DocBlockReader |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $comment; |
||
19 | |||
20 | public function __construct(ReflectionMethod $method) |
||
24 | |||
25 | /** |
||
26 | * Get the description of a method from the doc block |
||
27 | * @param ReflectionMethod $method |
||
|
|||
28 | * @return string|null |
||
29 | */ |
||
30 | public function getMethodDescription(): ?string |
||
44 | |||
45 | /** |
||
46 | * Get the parameter description |
||
47 | * @param ReflectionParameter $param |
||
48 | * @return string|null |
||
49 | */ |
||
50 | public function getParameterDescription(ReflectionParameter $param): ?string |
||
60 | |||
61 | /** |
||
62 | * Get the parameter type |
||
63 | * @param ReflectionParameter $param |
||
64 | * @return string|null |
||
65 | */ |
||
66 | public function getParameterType(ReflectionParameter $param): ?string |
||
76 | |||
77 | /** |
||
78 | * Get the return type |
||
79 | * @return string|null |
||
80 | */ |
||
81 | public function getReturnType(): ?string |
||
89 | } |
||
90 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.