Skip to content

Code conventions

jbroadway edited this page Oct 8, 2011 · 2 revisions

I've chosen the following naming conventions for the core libraries:

  • Classes start with capitals and use camel case.
  • Methods and functions use underscores (like Ruby :)

I also use tabs instead of spaces, trailing braces instead of giving them their own lines, and put a space before open braces and between operators, for example:

<?php

function foo_bar ($foo = false) {
	if (! $foo) {
		// etc.
	}
}

?>

Other than that, for documentation I use JavaDoc-style commenting and for inline comments I use the double-slash.

Clone this wiki locally