Skip to content

Further Style Guide Considerations

philsturgeon edited this page Oct 16, 2014 · 14 revisions

Since the PSR-1 and 2 were created there have been a few edge-cases that were missed out. These are style guide questions that have fallen through the cracks and were not addressed in any of the existing PSR's.

Some of these items may be added as errata, and when they do they can be removed from the list.

Others will remain on, as considerations for an eventual new style-guide. As the FIG moves towards a deprecate/replace workflow, PSRs will eventually be replaced, and one day we'll have another that replaces PSR-2. All existing errata will be added, and these new considerations will be taken into account too.

  • "All PHP files MUST end with a single blank line" actually means a single newline character (clarified by @pmjones, but not sure where)
  • Where do opening braces for functions go? (not methods, not closures) ML
  • Should "if ( ! " be an exception to the rule (ML)
  • Add finally to try, catch PR
  • Add chained variable declarations ML
Clone this wiki locally