Cphalcon: Validation messages

Created on 12 Dec 2017  路  10Comments  路  Source: phalcon/cphalcon

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.

breaks bc enhancement new feature request

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 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

All 10 comments

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

Thank you guys :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bestirani2 picture bestirani2  路  3Comments

hailie-rei picture hailie-rei  路  3Comments

ismail0234 picture ismail0234  路  3Comments

alvassin picture alvassin  路  3Comments

kkstun picture kkstun  路  3Comments