Skip to content

Coding Guidelines

ironpilot edited this page Feb 20, 2015 · 3 revisions
  1. We use Allman style braces, where each brace begins on a new line. A single line statement block can go without braces but the block must be properly indented on its own line.
  2. We use tabs for indentation.
  3. We use PascalCase for class names.
  4. We use camelCase properties and method names within classes.
  5. We always specify the visibility. (i.e. public function writeMe() not function writeMe()).
  6. Avoid more than one empty line at any time. For example, do not have two blank lines between class members.
  7. Avoid extra and trailing free spaces. For example avoid if(myVar == 0)..., where the dots mark the excess free spaces.
  8. If a file happens to differ in style from these guidelines, the existing style in that file will take precedence, until the entire file is refactored.
  9. Class constants are named in ALL_CAPS with underscores separating words and should be located as the first declaration in class definitions.

Clone this wiki locally