On Oct 15, 2013, at 5:18 AM, Paul Dragoonis <
drag...@gmail.com> wrote:
> Ignore comments guys, it removes documentation creativity. Lets not take the piss with this PSR.
PSR-2 explicitly does not address comments. They are entirely outside the scope of PSR-2. CodeSniffer can do what it wants, but what it cannot say is that comments are either compliant or non-compliant with PSR-2, since PSR-2 does not specify either way.
My *personal* opinion is that this style ...
// Do something if yes
if ($foo === true) {
echo "Yep"
// Do something if nope
} elseif ($foo !== true) {
echo "Nope";
// Fuck knows
} else {
die("Universe Implosion");
}
... is a bit off. I would argue for a modified version, where the comments actually go in the blocks they are commenting, with an overall comment on the block as a whole:
// yep, nope, or fuck knows
if ($foo === true) {
// Do something if yes
echo "Yep"
} elseif ($foo !== true) {
// Do something if nope
echo "Nope";
} else {
// Fuck knows
die("Universe Implosion");
}
--
Paul M. Jones
pmjo...@gmail.com
http://paul-m-jones.com