Skip to content

Developer guide: coding style

blackshadowshade edited this page Dec 12, 2012 · 5 revisions

Coding style for buttonmen development

We will use PSR-0, with the following modifications/additional preferences:

Braces

  • opening braces on same line for class names, function names, and control statements
  • control structure braces are always used, even for single line statements

Naming

  • camelCase for class names
  • lower_under for method names

Whitespace

  • indentation of 4 spaces
  • no horizontal whitespace inside parentheses
  • no space after function names
  • single space after control keywords

Other

  • TRUE/FALSE/NULL all in uppercase
  • soft line length limit of 80 characters, no hard line length limit

Clone this wiki locally