What about the PSR-1 and PSR-2 for CakePHP 3? https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-1-basic.md https://github.com/pmjones/fig-standards/blob/psr-1-style-guide/proposed/PSR-2-advanced.mdis that possible or it's against this standard?
Looking the rules, we currently follow the psr-1 fully. In the psr-2 we dont follow just few things, like tab/spaces and braces in new line for classes.
As Jose said, I am not a big fan from spaces and it can cause a huge impact in our codebase, once the merge between branches will cause a couple of conflicts.
Juan Basso
I'm all for standards that help code be portable.Cosmetic standards don't make sense to me, though.
Method names MUST be declared in camelCase.
On Friday, 1 June 2012 17:34:28 UTC+2, Graham Weldon wrote:I'm all for standards that help code be portable.Cosmetic standards don't make sense to me, though.
I'm ok with PSR-1.Cake mostly follows it anyway. I think the only exception isMethod names MUST be declared in camelCase.Because right now controller action names are underscored.I'm -1 on PSR-2.It's fundamentally cosmetic and an imposed preference. It's also not a standard - it's a guide.
If I agreed with the changes in PSR-2, I'd still be -1. It's a royal PITA to change existing code to match a new code-standard. I'm the guilty party of creating a huge amount of work for, mostly, mark by applying previous code-standard changes (such as a new line before all doc blocks) as such it doing it again we know it'll create merge conflicts and general annoyance in normal workflow (releases).AD
I decided to use cakephp several years ago after looking
at several other frameworks. Aside from the elegant internals, the CS is one I was happy with: one I could use, contribute, and enjoy working with.
Forcing this style on me after using this for several years
will make me real sad. It won't make me use something else,
nor stop my contribution, but it would surely make it less
enjoyable.
Much less.
I don't like spaces too, but I think the code "portable" and standardized are more important than just a preference of mine.
If code is only for me, I'll using tabs, but for a world class framework like CakePHP is not the case.
It is easy to type one space more or less by mistake. You can't configure spaces to appear as 1, 2 or 4 spaces width in your editor but you can configure that for tabs. So by using tabs everyone could set their preferred indent width by simply changing the width for tabs in the editor. Spaces were never thought and designed to be used for indention but tabs were exactly thought for that.And the decision to use spaces over tabs in PSR is in my opinion just a pure selfish decision because most of the PSR members simply won't change their code.-1 to spaces.