| 1 | <?php |
||
| 17 | class CheckToken implements ValidatorInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var TokenServiceInterface |
||
| 21 | */ |
||
| 22 | private $service; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var string|null |
||
| 26 | */ |
||
| 27 | private $error; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param TokenServiceInterface $service |
||
| 31 | * @param string|null $error optional custom error message |
||
| 32 | */ |
||
| 33 | 2 | public function __construct(TokenServiceInterface $service, $error = null) |
|
| 38 | |||
| 39 | 2 | public function validate(FieldInterface $field, InputModel $model, InputValidation $validation) |
|
| 51 | } |
||
| 52 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.