Php Framework Interoperability Group Have you heard of these guys?
Posted 10 November 2012 - 09:32 AM
I just bumped into this : https://github.com/p...g/fig-standards .
I absolutely don't know if this is a active community, since I'm not in the mailing list (for now), but I see all the main PHP frameworks (and others too) and not Yii. I think, as a professionnal framework, and if this 'group' is actually doing something, Yii should probably take part in it.
If it is not interresting for the Yii framework community to take part in this group, at least have a look at the coding standards they have proposed : https://github.com/p...master/accepted wich can be interresting (especially the idea of havin different levels of standard) to use in Yii.
Just dropping my 2 cents here...
Posted 10 November 2012 - 04:45 PM
Posted 11 November 2012 - 09:48 AM
In my opinion, coding standard should not be too restrictive, but must exist especially in a framework where contributor's extensions or plugins play a important role.
In that way, the PSR-0 is a very good minimal coding standard. Maybe that minimal should be enforced in the extensions to ensure a minimal quality and coherence.
Posted 13 November 2012 - 06:54 PM
I'm interested to know how yii will differ from PSR-1, it seems pretty sensible and very minimal.
I suspect i'm almost certainly in the minority however i'd love to see yii embrace PSR-2 as well - while some of the decisions taken are perhaps not to everyones taste at least it does move towards parity with the PHP community at large.
The one thing that I hope does change in the new Yii standard is the introduction of a bit more whitespace - personally I find a lot of the current code difficult to follow with the eye.
The lack of spaces after commas in most cases being particularly irksome as it flies against the common usage in the english language
Posted 14 November 2012 - 03:23 AM
Posted 15 November 2012 - 11:48 AM
I will never use brackets for single-line statements inside structures. Brackets for structures exist in order to wrap multiple lines, no multiple lines no brackets. Coding standards which use brackets for single-line statements are obtuse (this includes PSR-2).
Posted 15 November 2012 - 06:18 PM
From my perspective I actually find it easier to follow simply because the brackets are applied consistently regardless of the number of statements inside the structure.
Regardless, I suspect that the thread referenced by samdark above has already done this topic to death
Posted 16 November 2012 - 03:34 AM
Posted 22 April 2014 - 11:10 AM
+1 to these, also, following such standards is much easier on the eyes! especially when reading code you wrote a year ago, or someone else's code they wrote 5 years ago.
Posted 22 April 2014 - 03:04 PM
1. Yii is PHP-FIG member. I'm representative.
2. Yii2 adopted PSR-1, PSR-2, PSR-4.