Fix casing of validation rules in bake #1656

merged 1 commit into from Sep 18, 2013


None yet
4 participants

dereuromark commented Sep 18, 2013

This has been bothering me for a quite a while now.. I always had to manually rename the baked validation rules, as they did not match the actual method names.

Bake would simply lowercase all validation rules, and while this works due to PHP case insensitivity, this gets quite messy/unreadable at some point

'content' => array(
        'notempty' => array(
            'rule' => array('notempty'),

Same for maxLength, inList, ...
It is also a good practice to always name your called rules the same than their actual name.
Or bad casings like nOtEmpTY etc would also be valid and acceptable here :)

This bug-fix resolves this unnecessary lower-casing:

'content' => array(
        'notEmpty' => array(
            'rule' => array('notEmpty'),

josegonzalez commented Sep 18, 2013



ravage84 commented Sep 18, 2013

Cool 👍

markstory added a commit that referenced this pull request Sep 18, 2013

@markstory markstory merged commit e690c93 into cakephp:master Sep 18, 2013

1 check passed

default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment