Im not sure as to the reason behind this decision, but I feel that the validation messages for the included validators should be within the validators them selfs not the base class.
https://github.com/phalcon/cphalcon/blob/master/phalcon/validation.zep#L334-L360
This is a very minor issue and more of my ODD kicking in, just feel its better design to have each validator define its default message to allow for easier extension and reliable removal of validators.
Agreed. PRs are welcome. This should be a pretty straightforward refactor.
I would if I knew how to work with zephir :P
Just clone repo, install zephir extension into phpstorm and code it and do pr. Nothing fancy really.
I feel this issue should stay open. @sergeyklay
Closing in favor of #13855. Will revisit if the community votes for it, or in later versions.
@niden can you assign me this?
@emiliodeg all yours
I've been working on this and I want to share with you my design to receive opinions before doing all the work
I use an advice property to warning message, to avoid confusion with Phalcon\Messages\Message
Some validators like Phalcon\Validation\Validator\File starts to work like a container and split the inside validations in new validatos like Phalcon\Validation\Validator\File\Size, Phalcon\Validation\Validator\File\MimeType, Phalcon\Validation\Validator\File\Resolution, etc
The main idea is to have a transparent transition. All current definitions will continue to work as they do now
Resolved in https://github.com/phalcon/cphalcon/pull/14193
Thank you guys :)
Most helpful comment
I've been working on this and I want to share with you my design to receive opinions before doing all the work
I use an
adviceproperty to warning message, to avoid confusion withPhalcon\Messages\MessageSome validators like
Phalcon\Validation\Validator\Filestarts to work like a container and split the inside validations in new validatos likePhalcon\Validation\Validator\File\Size,Phalcon\Validation\Validator\File\MimeType,Phalcon\Validation\Validator\File\Resolution, etcThe main idea is to have a transparent transition. All current definitions will continue to work as they do now