cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG]: Phalcon 4.1.2 - Custom Validators - not working

Open phatnt93 opened this issue 3 years ago • 2 comments

Describe the bug Method validate() is not compatible when I extend \Phalcon\Validation\AbstractValidator class to create new Validator

See example: https://docs.phalcon.io/4.0/en/validation#custom-validators

Expected behavior I wanna create a Custom Validator

Screenshots image

Details

  • Phalcon version: 4.1.2
  • PHP Version: 7.4
  • Operating System: Ubuntu 20.4
  • Installation type: installing via package manager
  • Server: Nginx

phatnt93 avatar Mar 02 '23 01:03 phatnt93

You forgot to add : bool at the end of definition:

https://github.com/phalcon/ide-stubs/blob/77384e4f42542f11b065b2a860b9bca2ea20ad5a/src/Phalcon/Validation/ValidatorInterface.php#L45

Install ide-stubs as project's dev requirement in composer:

composer require --dev phalcon/ide-stubs:4.1.0

Jeckerson avatar Mar 02 '23 07:03 Jeckerson

Thank you!!!

phatnt93 avatar Mar 02 '23 07:03 phatnt93