| 1 | <?php |
||
| 7 | class Boolean extends AbstractBooleanCase implements SanitizeRuleInterface |
||
| 8 | { |
||
| 9 | /** @var bool|mixed */ |
||
| 10 | protected $trueValue; |
||
| 11 | |||
| 12 | /** @var bool|mixed */ |
||
| 13 | protected $falseValue; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param bool $true Use this value for `true`. |
||
| 17 | * @param bool $false Use this value for `false`. |
||
| 18 | */ |
||
| 19 | 114 | public function __construct($true = true, $false = false) |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Sanitize the value to a boolean, or a pseudo-boolean. |
||
| 27 | * |
||
| 28 | * @param object $subject The subject to be filtered. |
||
| 29 | * @param string $field The subject field name. |
||
| 30 | * @param mixed $true Use this value for `true`. |
||
|
|
|||
| 31 | * @param mixed $false Use this value for `false`. |
||
| 32 | * |
||
| 33 | * @return bool Always true. |
||
| 34 | */ |
||
| 35 | 108 | public function __invoke($subject, string $field): bool |
|
| 55 | } |
||
| 56 |
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.