Coding Style Convention ----------------------- PHP: /* copyright, license, blah-blah */ /* $Id: CodingStyle 1573 2006-04-26 16:28:15Z voxus $ */ class SomeClassName { private $privateVariable = null; private $yetAnotherVariable = null; public function someOddMethodName(FooInterface $someObject) { if (!$someObject) { TrashClass::staticMethod(); throw new FooException("help me!"); } else { $someObject->shortMethod( $firstLongParameter, $secondLongParameter->anotherMethod( $foo, $bah ) ); // do something useful } if ( $condition || $incindent || $whatEverElse ) { // bah! } $longString = 'foo' .'bar' .'blah'; // try to avoid casts $castedValue = (int) $rawVariable; return $this; } final public static anotherOddMethod() { try { self::someOddMethodName(new FooImplementation()); } catch (FooException $e) { // do something throw $e; // try to not "eat" exceptions } } } -- switch ($foo) { case $boo: $this->fooBar(); $that->fooBlah(); break; case $zoo: $that->phew($this); break; default: die(); break; } Class Method Sorting: * abstract public * abstract public static * abstract protected * abstract protected static * final public * final public static * public * public static * protected * protected static * private