We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation:validate()
Describe the bug Incorrect return type is defined in Phalcon\Filter\Validation:validate() method. It also can return false in line https://github.com/phalcon/cphalcon/blob/fc183e11e8b96c43daf7d893244846206dc2aa73/phalcon/Filter/Validation.zep#LL515C26-L515C26
Phalcon\Filter\Validation:validate()
false
To Reproduce You need to define beforeValidation() method, which requires bool return type and is called in lines above.
beforeValidation()
bool
<?php use Phalcon\Filter\Validation; class MyValidator extends Validation { public function beforeValidation(array|object $data, $entity, Messages $messages): bool { return false; } public function initialize(): void { // Validation rules... } }
Provide minimal script to reproduce the issue
$validator = new MyValidator(); if ($validator->validate() === false) { // This is valid. }
Expected behavior
Return type of Phalcon\Filter\Validation\ValidationInterface:validate() must be Messages|false
Phalcon\Filter\Validation\ValidationInterface:validate()
Messages|false
Details
The text was updated successfully, but these errors were encountered:
#16337 - Adjust Validation:validate() signature
c721c22
f4f7a0b
4425d27
Merge pull request #16338 from phalcon/#16337-validate-signature
101fbf2
Resolved in #16338
Sorry, something went wrong.
Jeckerson
No branches or pull requests
Describe the bug
Incorrect return type is defined in
Phalcon\Filter\Validation:validate()
method.It also can return
false
in line https://github.com/phalcon/cphalcon/blob/fc183e11e8b96c43daf7d893244846206dc2aa73/phalcon/Filter/Validation.zep#LL515C26-L515C26To Reproduce
You need to define
beforeValidation()
method, which requiresbool
return type and is called in lines above.Expected behavior
Return type of
Phalcon\Filter\Validation\ValidationInterface:validate()
must beMessages|false
Details
The text was updated successfully, but these errors were encountered: