DotKernel Coding Standard

March 28th, 2008  by admin

Posted in DotKernel

Leave a reply »

Tags:

dotKernel will be a “skeleton”of Zend Framework.
DotKernel borrowed the coding standard from Zend Framework: ZF Coding Standard with some exceptions.

In what follows, we will make remarks only on those features that are slightly different in the coding standards of dotKernel.

B.2. PHP File Formatting

B.3. Naming Conventions

Camel naming convention

  • B.3.1. Classes
  • starts with Dot_ (e.g. Dot_Templates)

  • B.3.2. Interfaces
  • ends with the string “Interface”(e.g. Dot_Db_Interface)

  • B.3.3. Filenames
  • classes will have double extension: “.inc.php”
    All other php files will have the extension “.php”

B.4.6. Control Statements
every starting curly brace } after a statement starts on a new line, end it’s closing curly brace } will be on a new line too. The start and end braces must be on the same column (for better indentation of the code)
e.g:

if ($a != 2)
{
   $a = 2;
}
if ($a != 2)
{
    $a = 2;
    if($a == 2)
    {
       $c = 3;
    }
}

Leave a Reply