| 1 | <?php |
||
| 8 | class MaxComplexityVisitor implements VisitorInterface { |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var int |
||
| 12 | */ |
||
| 13 | protected $defaultCost; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * MaxComplexityQueryVisitor constructor. |
||
| 17 | * |
||
| 18 | * @param int $maxComplexity |
||
|
|
|||
| 19 | * The allowed maximum complexity. |
||
| 20 | */ |
||
| 21 | public function __construct($defaultCost = 1) { |
||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | */ |
||
| 28 | public function visit(array $args, FieldInterface $field, $children) { |
||
| 39 | |||
| 40 | /** |
||
| 41 | * {@inheritdoc} |
||
| 42 | */ |
||
| 43 | public function reduce($carry, $current) { |
||
| 46 | |||
| 47 | /** |
||
| 48 | * {@inheritdoc} |
||
| 49 | */ |
||
| 50 | public function initial() { |
||
| 53 | } |
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.