| 1 | <?php |
||
| 5 | class Callback implements SanitizeRuleInterface |
||
| 6 | { |
||
| 7 | /** @var callable */ |
||
| 8 | protected $callback; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @param callable $callback Function to use. |
||
| 12 | */ |
||
| 13 | 6 | public function __construct(callable $callback) |
|
| 17 | |||
| 18 | /** |
||
| 19 | * Sanitizes a value using a callable/callback. |
||
| 20 | * |
||
| 21 | * @param object $subject The subject to be filtered. |
||
| 22 | * @param string $field The subject field name. |
||
| 23 | * @param callable $callable A callable/callback. |
||
|
|
|||
| 24 | * |
||
| 25 | * @return bool True if the value was sanitized, false if not. |
||
| 26 | */ |
||
| 27 | 6 | public function __invoke($subject, string $field): bool |
|
| 31 | } |
||
| 32 |
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.