| 1 | <?php declare(strict_types = 1); |
||
| 13 | class GenericGenerator extends AbstractGenerator |
||
| 14 | { |
||
| 15 | /** @var ClassGenerator[] Collection of classes */ |
||
| 16 | protected $classes = []; |
||
| 17 | |||
| 18 | /** @var FunctionGenerator[] Collection of functions */ |
||
| 19 | protected $functions = []; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Set function. |
||
| 23 | * |
||
| 24 | * @param string $name Function |
||
| 25 | * @param bool $isStatic Flag that function is static |
||
|
|
|||
| 26 | * |
||
| 27 | * @return FunctionGenerator New function generator instance |
||
| 28 | */ |
||
| 29 | public function defFunction(string $name) : FunctionGenerator |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Set class. |
||
| 36 | * |
||
| 37 | * @param string $name Class name |
||
| 38 | * |
||
| 39 | * @return ClassGenerator |
||
| 40 | */ |
||
| 41 | public function defClass(string $name) : ClassGenerator |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Generate code. |
||
| 48 | * |
||
| 49 | * @param int $indentation Code level |
||
| 50 | * |
||
| 51 | * @return string Generated code |
||
| 52 | */ |
||
| 53 | public function code(int $indentation = 0) : string |
||
| 65 | } |
||
| 66 |
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
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.