Skip to content
This repository was archived by the owner on Jan 16, 2019. It is now read-only.

Dev CodingGuidelines Indention

Frank Kleine edited this page Apr 7, 2012 · 1 revision

Table of Contents

Developer pages: Coding Guidelines

PHP code tags, indention and line breaks

Indention is done with four spaces, tabs are not allowed. Only Unix line breaks are allowed.

Always use code tags. Any other code tags are forbidden. There is no line break after the closing ?> tag.

Indention on variable declarations

If several variable declarations follow one after another equal signs should be all on the same level:

$foo   = 'Foo';
$foo42 = 42;

This rule may be neglected if one of the variable names is very long and readability of the code would be worse with indention according to this rule.

On each side of the equal sign must be at least one space.

Line length

Line length should not exceed 80 characters. The decision is up to the developer, but the maximum line length must not be more than 140 characters.

Line length in comment lines must not exceed 80 characters.

Blank lines

Blank lines improve readability of code. The should be used

  • between methods
  • after blocks
  • between logical sections within a method

Note: there is never a blank line between properties.



Next: Nomenclature



---
Back to developer pages

Clone this wiki locally